Powershell LOGOFF forcefully the mentioned Users
Powershell LOGOFF forcefully the mentioned Users"
$servers = Get-content c:\servers.csv
$username = 'clusteradmin'
ForEach ($server in $servers)
{
$session = ((quser /server:$server | ? { $_ -match $username }) -split ' +')[2]
logoff $session /server:$server
}
---
Get computers name from specified OU:
$serv = Get-ADComputer -Filter * -SearchBase "OU=Cluster-Server,DC=pugazh,DC=co,DC=in" -Properties * | Select -Property Name
Comments
Post a Comment