Refactor script to determine distinguished name
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		| @@ -66,11 +66,9 @@ If (@('primary','standalone') -contains $Parameter['deployment.type']) { | |||||||
|  |  | ||||||
|     ForEach ($Entry in $Delegations.DelegationEntries) { |     ForEach ($Entry in $Delegations.DelegationEntries) { | ||||||
|         $GetADObjectSplat = @{ |         $GetADObjectSplat = @{ | ||||||
|             Filter      = '*' |             Identity = $Entry.OrganizationalUnit + (($Parameter['addsconfig.domainname'] -split '\.' | ForEach-Object {',DC={0}' -f $_}) -join '') | ||||||
|             SearchBase  = 'DC=' + $Parameter['addsconfig.domainname'].Replace('.', ',DC=') |  | ||||||
|             SearchScope = 'OneLevel' |  | ||||||
|         } |         } | ||||||
|         $OU = Get-ADObject @GetADObjectSplat | Where-Object {$_.DistinguishedName -match $Entry.OrganizationalUnit} |         $OU = Get-ADObject @GetADObjectSplat | ||||||
|         $GetACLSPlat = @{ |         $GetACLSPlat = @{ | ||||||
|             Path = "$($PSDrive.Name):\$($OU.DistinguishedName)" |             Path = "$($PSDrive.Name):\$($OU.DistinguishedName)" | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user