代码语言:powershell 复制 # 导入Active Directory模块Import-ModuleActiveDirectory# 获取OU的DistinguishedName$ouDN="OU=Users,DC=example,DC=com"# 获取OU的固有权限$ouACL=Get-Acl"AD:\$ouDN"# 启用对象权限$ouACL.SetAccessRuleProtection($true,$false)$ouACL.AddAccessRule((New-ObjectSystem.Directory...
Get-NetUser Get-NetGroup Get-NetGroupMember Get-NetLocalGroup Get-NetSession Invoke-UserHunter Get-NetOU Find-GPOLocation Get-NetGPOGroup Get-ObjectACL Add-ObjectACL Invoke-ACLScanner Set-ADObject Invoke-DowngradeAccount Get-NetForest Get-NetForestTrust Get-NetForestDomain Get-NetDomainTrust Get-Ma...
Get-NetOU -FullData # Get computers in an OU # %{} is a looping statement Get-NetOU -OUName StudentMachines | %{Get-NetComputer -ADSPath $_} # Get GPOs applied to a specific OU Get-NetOU *student* | select gplink Get-NetGPO -Name "{3E04167E-C2B6-4A9A-8FB7-C811158DC97C}...
Consultez la page Politique de support Microsoft pour plus d’informations sur la prise en charge de ce produit, de ce service, de cette technologie ou de cette API. Retour au site principal Rechercher MSDN TechNet Forums Windows Windows PowerShell Index -contains operator vs .contains() method...
Path="C:\SharedFolder"$Account="Domain\User"$Permission="FullControl"$ACL=Get-Acl-Path$SharePath$Rule=New-ObjectSystem.Security.AccessControl.FileSystemAccessRule($Account,$Permission,"ContainerInherit, ObjectInherit","None","Allow")$ACL.SetAccessRule($Rule)Set-Acl-Path$SharePath-AclObject$ACL...
When you query for an object to get its ACL, you need to search based onDistinguished Name. Use the following statement to get the ACL for theMyOrgOUorganization unit in theContoso.com. Copy PS>(Get-Acl-Path"AD:OU=MyOrgOU,DC=Contoso,DC=com").AccessActiveDirectoryRights:CreateChild,Delet...
GetAclCommand Defines the implementation of the 'get-acl' cmdlet. This cmdlet gets the security descriptor of an item at the specified path. GetAliasCommand The implementation of the "get-alias" cmdlet. GetAuthenticodeSignatureCommand Defines the implementation of the 'get-AuthenticodeSignature'...
Add-Content -Path .\ACL-APAC.CSV -Value"GroupName,EmpNo,Name"#方法一:(后写)Import-Csv .\Groups.CSV |ForEach-Object {#下面这句获得组的名称,然后追加输出到CSV文件Get-ADGroup -Filter* -SearchBase$_.GroupName | select -ExpandProperty Name | Out-File$report-Encoding ASCII -Append#下面这个循...
SearchBase"OU=OU,$ADDomainDistName"|Sort-ObjectCanonicalNameforeach($ADUserin$ADUsers){$ACL=Get-Acl-Path("AD:"+$ADUser.DistinguishedName)Write-Host$ADUser.Name-NoNewlineif($ACL.Owner-eq"$ADDomainName\Domain Admins"){Write-Host' OK'-ForegroundColor Green}elseif($ACL.Owner-mat...
此参数的有效输入是由 Get-OrganizationalUnit cmdlet 返回的组织单位 (OU) 或域。 可以使用任何能够唯一标识此 OU 或域的值。 例如: 名称 名称 可分辨名称 (DN) GUID 此参数对服务中的邮箱没有影响。 展开表 类型: OrganizationalUnitIdParameter Position: Named 默认值: None 必需: False 接受管道输入: Fal...