我有一个确定用户标识的脚本,一旦我拥有该用户标识,我想使用不同的凭据对该用户标识运行脚本块.这可能吗?谁能告诉我这方面的例子?我很感激.提前致谢.:-)
我想要获取我的域中所有已启用且具有 2003 操作系统的计算机,并且计算机名称不包含“ ping 、 pict 、 pire ” 这是我所拥有的,但完全失败:
Get-ADComputer -filter {(Enabled -eq $True) -and (OperatingSystem -like "*2003*")} -properties OperatingSystem | where {($_.Name -notlike 'PING*') -or ($_.Name -notlike 'PICT*') -or ($_.Name -notlike 'PIRE*')} | Select Name
Run Code Online (Sandbox Code Playgroud)