File tree Expand file tree Collapse file tree
Elements/AutoUnattend/ActiveDirectory Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,6 +234,12 @@ Module DomainServicesModule
234234 Return String .Join( "," , pathParts)
235235 End Function
236236
237+ ''' <summary>
238+ ''' The user account is disabled
239+ ''' </summary>
240+ ''' <remarks></remarks>
241+ Private Const ADS_UF_ACCOUNTDISABLE As Integer = &H2
242+
237243 ''' <summary>
238244 ''' Determines whether an account in a domain is enabled
239245 ''' </summary>
@@ -262,7 +268,7 @@ Module DomainServicesModule
262268 Dim dirEntry As DirectoryEntry = result.GetDirectoryEntry()
263269 If dirEntry.NativeGuid = "" Then Return False
264270
265- enabledStatus = Not Convert.ToBoolean( CInt (dirEntry.Properties( "userAccountControl" ).Value) And &H2 )
271+ enabledStatus = Not Convert.ToBoolean( CInt (dirEntry.Properties( "userAccountControl" ).Value) And ADS_UF_ACCOUNTDISABLE )
266272 Next
267273 searcher.Dispose()
268274 Catch ex As Exception
You can’t perform that action at this time.
0 commit comments