testing new script
This commit is contained in:
@@ -7,15 +7,13 @@ $InactiveDays = 14
|
||||
$ComputerName = $env:computername
|
||||
|
||||
|
||||
Set-strictmode -version latest
|
||||
|
||||
ForEach ($computer in $ComputerName)
|
||||
{
|
||||
$profilesFound = 0
|
||||
|
||||
$profiles = Get-CimInstance -Class Win32_UserProfile -Computer $computer
|
||||
Try {
|
||||
$profiles = Get-CimInstance -Class Win32_UserProfile -Computer $computer -EnableAllPrivileges
|
||||
$profiles = Get-WmiObject -Class Win32_UserProfile -Computer $computer -EnableAllPrivileges
|
||||
} Catch {
|
||||
Write-Warning "Failed to retreive user profiles on $ComputerName"
|
||||
Exit
|
||||
|
||||
Reference in New Issue
Block a user