도메인에 일부 클라이언트가 있고 일부는 없습니다. 특정 로컬 사용자가있는 클라이언트를 검색 한 다음 삭제하는 방법을 알아야합니다. GPO를 사용하면 도메인 클라이언트가 매우 쉽습니다.하지만 도메인이 아닌 클라이언트는 어떻습니까? Powershell 명령 Get-LocalUser 및 Delete-LocalUser를 알고 있지만 모든 단일 PC에서 실행하고 싶지는 않습니다. 도움이 될만한 스크립트를 알고 계십니까?
감사
도메인이 아닌 컴퓨터에서 PSRemoting ( 작업 그룹 모드 ) 을 활성화 한 다음 원격을 사용하여이를 수행 할 수 있으며 해당 시스템에는 최신 PSv5가 설치되어 있거나 MS powershellgallery.com의 로컬 사용자 관리 모듈이 있어야합니다.
원격을 설정하려면 여전히 각 컴퓨터를 만져야합니다.
• 독립 실행 형 (작업 그룹) 컴퓨터에서 PowerShell Remoting 사용
• 두 작업 그룹 컴퓨터 간의 PowerShell 원격
• 독립 실행 형 작업 그룹 컴퓨터 간의 PowerShell PS 원격
• 두 작업 그룹 컴퓨터 간의 PowerShell 원격
모든 세부 사항을 알 수 있도록 각 기사를 읽으십시오. 그러나 스 니펫에서는 다음과 같습니다.
### Remote Computer
NetConnectionProfile -NetworkCategory Private
Enable-PSRemoting -SkipNetworkProfileCheck -Force
Set-NetFirewallRule –Name "WINRM-HTTP-In-TCP-PUBLIC" –RemoteAddress Any
### Local computer
# Review teh trusted host file
Get-Item WSMan:\localhost\Client\TrustedHosts
# Set the trusted a specific target
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "10.0.2.33" -Force
# Or for several hosts if you don't want to specify them individually
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
# Connect to a host
Enter-PSSession -ComputerName 10.0.2.33 -Credential $Credentials
원격을 활성화하지 않고 실행할 수있는 몇 가지 PowerShell 명령이 있습니다 .
• Remoting 또는 WinRM을 사용하지 않고 Windows PowerShell을 사용하여 원격으로 작업
Get-WinEvent
Get-Counter
Get-EventLog
Clear-EventLog
Write-EventLog
Limit-EventLog
Show-EventLog
New-EventLog
Remove-EventLog
Get-WmiObject
Get-Process
Get-Service
Set-Service
Get-HotFix
Restart-Computer
Stop-Computer
Add-Computer
Remove-Computer
Rename-Computer
Reset-ComputerMachinePassword
또는 MS Sysinternals PSExec.exe 도구를 사용하십시오.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다