Hello there,
I have 20 VMs joined to Azure AD, using the below command in script.bat:
cmdkey /add:ServerName1 /user:DomainName\%USERNAME% /pass:%password%
> cmdkey /add:ServerName2 /user:DomainName\%USERNAME% /pass:%password%
Add the credentials to Windows Credential Manager successfully.
However: when I am running the script using local group policy:
User configuration > Windows Settings > Scripts(logon/logoff) > logon
the rsop.msc shows that the script's last run time is during the logon process! BUT, no Creds get added to the Windows Credential Manager.
I decided to add some delay, and renamed the script to be script.ps1 with this context:
Start-Sleep -Seconds 30
> cmdkey /add:ServerName1 /user:DomainName\%USERNAME% /pass:%password%
> cmdkey /add:ServerName2 /user:DomainName\%USERNAME% /pass:%password%
I also tried the options shown below, but none of them worked:
Any idea on how to make this simple task work?