In Windows 7 Prof, executing in Windows Powershell_ISE (as administrator) the Powershell (ver. 3) commands produces expected result (of adding a domain user to local/machine Administrators group) but launching it from a script .ps1 file in folder C:\Users\myDomainUser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
does not !?
$objGroup = [ADSI]("WinNT://myComputerName/Администраторы")'Administrators in Russian
$objUser = [ADSI]("WinNT://myDomainName/myDomainUser")
$objGroup.PSBase.Invoke("Add", $objUser.PSBase.Path)
Why?
How to better add a domain user to local administrators group on Windows 7 reboot?