I am in the middle of writing a Powershell script to create Windows 7 Build. Currently am working on changing UAC status (need to turn it completely off because we have our own firewalls, et al). The script works to turn off UAC Status, but then I need to restart the system and this command:
(Get-WmiObject - Class Win32_OperatingSystem - ComputerName $system).Win32Shutdown(6)
is returning the error:
Exception calling "Win32Shutdown" : "Privilege not held. " $system is assigned earlier with:
$system = Get-Content env:computername
Also, what I'd REALLY like to know is if there is a way to restart the computer, but then have it continue on with my script. I may have to do that several times in this script.
Thank you!