

- #Sccm run script schedule update#
- #Sccm run script schedule manual#
- #Sccm run script schedule windows#
$strMailSubMan = $strSrv + " rebooted but didn't remove its Manual Reboot File" $strMailBMan = $strSrv + " Server has not deleted its Manual Reboot File, please investigate at " + $strDate $strMailBNoReboot = $strSrv + " Server was not restarted by the Restart Computer with Reg Check script at " + $strDate + "`n" + "`n" + "Pending File Rename Value : " + "`n" + $objRBP.NoRebootFiles $strMailSubNoReboot = $strSrv + " has not restarted (pending file rename operation)" $strMailSub = $strSrv + " restarted by script"
#Sccm run script schedule update#
$strMailB = $strSrv + " Server was restarted by the Restart Computer with Reg Check script at " + $strDate + "`n" + "Restart Reason `n" + "CBServicing : " + $objRBP.CBServicing + "`n" + "Windows Update : " + $objRBP.WindowsUpdate + "`n" + "Pending Computer Rename : " + $objRBP.PendComputerRename + "`n" + "Pending File Rename : " + $objRBP.PendFileRename + "`n" + "Pending File Rename Value : " + $objRBP.PendFileRenVal If ($WMI_OS.BuildNumber -ge 6001) | select RebootPending,CBServicing,WindowsUpdate,PendComputerRename,PendFileRename,PendFileRenVal # If Vista/2008 & Above query the CBS Reg Key

# Making registry connection to the local/remote computer $WMI_OS = Get-WmiObject -Class Win32_OperatingSystem -Property BuildNumber, CSName -ComputerName $Computer -ErrorAction Stop
#Sccm run script schedule windows#
# Setting CBSRebootPend to null since not all versions of Windows has this value $CompPendRen,$PendFileRename,$Pending,$ SCCM = $false,$false,$false,$false # Setting pending values to false to cut down on the number of else statements Net Registry connection, replaced with WMI StdRegProv Removed $Data variable from the PSObject - it is not neededīug with the way CCMClientSDK returned null value if it was falseĪdded PendFileRenVal - Contents of the PendingFileRenameOperations Reg Entry UpdNote: Added CCMClient property - Used with SCCM 2012 Clients onlyĪdded ValueFromPipelineByPropertyName=$true to the ComputerName Parameter This example will create a report that contains pending reboot information. PS C:\> Get-PendingReboot -Computer $Servers | Export-Csv C:\PendingRebootReport.csv -NoTypeInformation PS C:\> $Servers = Get-Content C:\Servers.txt This example will query the local machine for pending reboot information. Nor was the PendingFileRenameOperations value populated. Null values are by design, since these systems do not have the SCCM 2012 client installed, Information from the systems contained in the file and display the output in a table. This example will capture the contents of C:\ServerList.txt and query the pending reboot Get-PendingReboot -ComputerName (Get-Content C:\ServerList.txt) | Format-Table -AutoSizeĬomputer CBServicing WindowsUpdate CCMClientSDK PendFileRename PendFileRenVal RebootPending
