Link to home
Create AccountLog in
Avatar of Parity123
Parity123Flag for United States of America

asked on

Powershell : Question

Hello experts,

I have the following script:

get-credential | export-clixml c:\temp\temp1.xml
$cred = import-clixml -path c:\temp\temp1.xml

get-addomain -identity test.local -Cred $cred
:::::::::

the above script works if I run it from a command prompt and fails when I run this in a scheduled task. I get access denied, must be the creds are not getting passed.

Please assist.
ASKER CERTIFIED SOLUTION
Avatar of Jeremy Weisinger
Jeremy Weisinger

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Jeremy Weisinger
Jeremy Weisinger

Best solution