-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schemamaster Role is always $false #2
Comments
Thanks Christian. Appreciate picking that up. I haven’t used this script for many years. This is not my script though. It was written by Zachary Loeber, but just happens to be in my Github repository. I see there is a newer version available on the web, but haven’t looked at what changes he made.
Cheers,
Jeremy
From: Christian Ritter ***@***.***>
Sent: Monday, 24 October 2022 5:35 PM
To: jeremyts/ActiveDirectoryDomainServices ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [jeremyts/ActiveDirectoryDomainServices] Schemamaster Role is always $false (Issue #2)
When executing the script: https://github.com/jeremyts/ActiveDirectoryDomainServices/blob/master/Audit/New-ADAssetReport.ps1
The Schemamaster is always false, checked on several environments.
The problem is the following Code Segement:
if ($GCNames -match $DC.Name) { $IsGC = $true } if ($DC.Roles -match 'RidRole') { $IsRidMaster = $true } if ($DC.Roles -match 'PdcRole') { $IsPdcMaster = $true } if ($DC.Roles -match 'InfrastructureRole') { $IsInfraMaster = $true } if ($DC.Roles -match 'SchemaRole') { $IsSchemaMaster = $true } if ($DC.Roles -match 'NamingRole') { $IsNamingMaster = $true }
Using -match is causing the issue, while using -contains solves this.
This happens because .Roles is an enum object and SchemaRole is the first entry which is at index 0.
—
Reply to this email directly, view it on GitHub<#2>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABYSDBGJQPHWGU75OQLN4BTWEZJ5DANCNFSM6AAAAAARMZKMP4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Thanks for mentioning. Raised an issue there as well by now. Maybe you want to fix these for your repo also :) Best regards |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When executing the script: https://github.com/jeremyts/ActiveDirectoryDomainServices/blob/master/Audit/New-ADAssetReport.ps1
The Schemamaster is always false, checked on several environments.
The problem is the following Code Segement:
if ($GCNames -match $DC.Name) { $IsGC = $true } if ($DC.Roles -match 'RidRole') { $IsRidMaster = $true } if ($DC.Roles -match 'PdcRole') { $IsPdcMaster = $true } if ($DC.Roles -match 'InfrastructureRole') { $IsInfraMaster = $true } if ($DC.Roles -match 'SchemaRole') { $IsSchemaMaster = $true } if ($DC.Roles -match 'NamingRole') { $IsNamingMaster = $true }
Using -match is causing the issue, while using -contains solves this.
This happens because .Roles is an enum object and SchemaRole is the first entry which is at index 0.
The text was updated successfully, but these errors were encountered: