Added Wake flag and added LastLogon to SHSUser
This commit is contained in:
parent
e41c8897dd
commit
be0294c5ef
|
|
@ -51,7 +51,7 @@ Copyright = '(c) 2019 Chuck Beddow. All rights reserved.'
|
||||||
# ProcessorArchitecture = ''
|
# ProcessorArchitecture = ''
|
||||||
|
|
||||||
# Modules that must be imported into the global environment prior to importing this module
|
# Modules that must be imported into the global environment prior to importing this module
|
||||||
# RequiredModules = @()
|
RequiredModules = @('ConfigurationManager')
|
||||||
|
|
||||||
# Assemblies that must be loaded prior to importing this module
|
# Assemblies that must be loaded prior to importing this module
|
||||||
# RequiredAssemblies = @()
|
# RequiredAssemblies = @()
|
||||||
|
|
|
||||||
7
Private/Invoke-Wake.ps1
Normal file
7
Private/Invoke-Wake.ps1
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
function Invoke-Wake($Computer) {
|
||||||
|
Write-Host "Attemping to wake up $Computer, check in a few minutes"
|
||||||
|
Push-Location
|
||||||
|
Set-Location "$(Get-PSDrive -PSProvider CMSite)`:"
|
||||||
|
Invoke-CMClientAction -DeviceName $Computer -ActionType ClientNotificationWakeUpClientNow
|
||||||
|
Pop-Location
|
||||||
|
}
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
$printerHost = "$printerName$domain"
|
$printerHost = "$printerName$domain"
|
||||||
#Write-Host $printerHost
|
#Write-Host $printerHost
|
||||||
$testHost = Resolve-DnsName $printerHost
|
$testHost = Resolve-DnsName $printerHost
|
||||||
if($testHost -ne $null) {
|
if($null -ne $testHost) {
|
||||||
$hit = $true
|
$hit = $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
Phone=$null
|
Phone=$null
|
||||||
Email=$null
|
Email=$null
|
||||||
Computers=$null
|
Computers=$null
|
||||||
|
LastLogon=$null
|
||||||
}
|
}
|
||||||
$obj = New-Object -TypeName PSObject -Property $props
|
$obj = New-Object -TypeName PSObject -Property $props
|
||||||
|
|
||||||
|
|
@ -57,7 +58,7 @@
|
||||||
Phone=$UserInfo.telephoneNumber
|
Phone=$UserInfo.telephoneNumber
|
||||||
Email=$UserInfo.EmailAddress
|
Email=$UserInfo.EmailAddress
|
||||||
Computers=$computerList
|
Computers=$computerList
|
||||||
|
LastLogon=$UserInfo.LastLogonDate
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = New-Object -TypeName PSObject -Property $props
|
$obj = New-Object -TypeName PSObject -Property $props
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ Function Get-PC {
|
||||||
-RemoteDesktopApp | remote into computer using RDP
|
-RemoteDesktopApp | remote into computer using RDP
|
||||||
-RequestLauncher | starts request launcher
|
-RequestLauncher | starts request launcher
|
||||||
-ResetRepository | remotely resets repository
|
-ResetRepository | remotely resets repository
|
||||||
|
-Resources | more details about system resources
|
||||||
-SCCM | queries sccm for the computer information
|
-SCCM | queries sccm for the computer information
|
||||||
-SHSPrinter | pulls data about a printer using snmp
|
-SHSPrinter | pulls data about a printer using snmp
|
||||||
-SHSPrinterweb | pulls data about a printer and opens web interface and orion
|
-SHSPrinterweb | pulls data about a printer and opens web interface and orion
|
||||||
|
|
@ -62,6 +63,7 @@ Function Get-PC {
|
||||||
-Usb | shows installed usb devices
|
-Usb | shows installed usb devices
|
||||||
-UserProfileBackup | backups and restores user profiles
|
-UserProfileBackup | backups and restores user profiles
|
||||||
-ViewerRemote | remote into the computer using RemoteViewer
|
-ViewerRemote | remote into the computer using RemoteViewer
|
||||||
|
-Wake | attempts to wake on LAN
|
||||||
-WinProfileRebuild | rebuilds user profiles
|
-WinProfileRebuild | rebuilds user profiles
|
||||||
|
|
||||||
For more detailed help please see the documentation on AppDoc
|
For more detailed help please see the documentation on AppDoc
|
||||||
|
|
@ -110,6 +112,7 @@ Function Get-PC {
|
||||||
[switch]$Usb,
|
[switch]$Usb,
|
||||||
[Switch]$UserProfileBackup,
|
[Switch]$UserProfileBackup,
|
||||||
[Switch]$ViewerRemote,
|
[Switch]$ViewerRemote,
|
||||||
|
[Switch]$Wake,
|
||||||
[Switch]$WinProfileRebuild
|
[Switch]$WinProfileRebuild
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -301,6 +304,11 @@ Function Get-PC {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($Wake) {
|
||||||
|
Invoke-Wake $comp
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
#PING HERE - All commands after here either require the computer to be online or need to know
|
#PING HERE - All commands after here either require the computer to be online or need to know
|
||||||
#------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
||||||
$Connection = Test-Connection -ComputerName $comp -Count 1
|
$Connection = Test-Connection -ComputerName $comp -Count 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue