Hello Together
I'am new to this Forum and i need help to solve me Problem, i will connect with me Poweshell Session to me AD and do any possible changes.
-- > Get-ADUser -Identity macalo | fl *
This command will be run without Problem.
But if i will Run this Command "tsp.ps1" i will become this following error:
c:\>c:\tsp.ps1
$Credentials = Get-Credential
Import-Module ActiveDirectory Get-ADUser wiam | ForEach-Object { $User = [ADSI]"LDAP://$($_.DistinguishedName)" $User.psbase.invokeset("TerminalServicesProfilePath","") $User.psbase.invokeset("TerminalServicesHomeDrive","J:") $User.psbase.invokeset("TerminalServicesHomeDirectory","\\alnmjst01\wiam") $User.setinfo() }
---
ErrorMessage:
Ausnahme beim Aufrufen von "setinfo" mit 0 Argument(en): "Zugriff verweigert
"
In C:\Temp\tsp.ps1:8 Zeichen:1
+ $User.setinfo()
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : CatchFromBaseAdapterMethodInvokeTI
thanks for any Help
Mauri
- Edited by maui72 16 hours 4 minutes ago