mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
win_domain - fix for checking for domain on new host (#55195)
This commit is contained in:
@@ -74,7 +74,8 @@ try {
|
||||
# Cannot use Get-ADForest as that requires credential delegation, the below does not
|
||||
$forest_context = New-Object -TypeName System.DirectoryServices.ActiveDirectory.DirectoryContext -ArgumentList Forest, $dns_domain_name
|
||||
$forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetForest($forest_context)
|
||||
} catch [System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException] { }
|
||||
} catch [System.DirectoryServices.ActiveDirectory.ActiveDirectoryObjectNotFoundException] {
|
||||
} catch [System.DirectoryServices.ActiveDirectory.ActiveDirectoryOperationException] { }
|
||||
|
||||
if (-not $forest) {
|
||||
$result.changed = $true
|
||||
|
||||
Reference in New Issue
Block a user