Quantcast
Channel: psappdeploytoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1769

New Post: Function to detect pending reboot

$
0
0
Requires SCCM Client (WMI class CCM_ClientUtilities must exist)
Function IsRebootPending{
<#
    .SYNOPSIS
        Check if the pending reboot exists. Returns $true or $false.
    .PARAMETER Computer
        Computer to detect if a pending reboot exists, default is local machine.
    .EXAMPLE
        IsRebootPending -Computer "PC0001"    
#>
    param(
        [Parameter(Mandatory=$false,Position=1, HelpMessage="Computer to run detection against")]
        [ValidateNotNullOrEmpty()]
        [String[]]
        $ComputerName = $env:COMPUTERNAME        
    )
    
    $reboot = [wmiclass]"\\$ComputerName\root\ccm\ClientSDK:CCM_ClientUtilities"
    $result = $reboot.DetermineIfRebootPending() | Select RebootPending
    $result.RebootPending
}

Viewing all articles
Browse latest Browse all 1769

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>