0
我一直在尋找如何找到網絡計算機上的SID的位置,但迄今沒有。搜索網絡電腦的用戶SID
我需要搜索我們的網絡,並查詢所有PC的查找是否存在特定的SID,並向我提供出現此用戶SID的PC。
任何想法,因爲我畫空白。
我一直在尋找如何找到網絡計算機上的SID的位置,但迄今沒有。搜索網絡電腦的用戶SID
我需要搜索我們的網絡,並查詢所有PC的查找是否存在特定的SID,並向我提供出現此用戶SID的PC。
任何想法,因爲我畫空白。
試試這個。獲取用戶名,轉換爲SID,然後在域中搜索註冊表中該SID的所有計算機(用戶必須先登錄,否則註冊表項不存在)。
$User = "Username"
$SID = Get-ADUser -Identity $User | Select -ExpandProperty SID
$ComputerList = Get-ADComputer -Filter * | Select -ExpandProperty DNSHostName
foreach ($Computer in $ComputerList){
if (Test-Connection -ComputerName $Computer -Quiet -Count 1) {
$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('Users', $Computer)
if ($Reg.OpenSubKey("$SID")) {
Write-Output "$User found on $Computer."
}
else {
Write-Output "$User not found on $Computer."
}
}
else {
Write-Output "$Computer unreachable."
}
}
您是域中的用戶嗎?你能通過PowerShell遠程訪問所有的計算機嗎? –
你想達到什麼目的?查找用戶當前登錄的計算機? –