Nice!
Works lika a charm. Is there a place where I can find "all" other possible useraccountcontrol values, than those included in the script?
I have also these:
544
546
4096
16777728
16843264
included in this code now:
'AcctCtrl' = ( CASE WHEN userAccountControl = 2 THEN 'Account is Disabled'
WHEN userAccountControl = 16 THEN 'Account Locked Out'
WHEN userAccountControl = 17
THEN CONVERT (VARCHAR(48), 'Entered Bad Password')
WHEN userAccountControl = 32
THEN CONVERT (VARCHAR(48), 'No Password is Required')
WHEN userAccountControl = 64
THEN CONVERT (VARCHAR(48), 'Password CANNOT Change')
WHEN userAccountControl = 512 THEN 'Normal'
WHEN userAccountControl = 514 THEN 'Disabled Account'
WHEN userAccountControl = 544 THEN 'Enabled, Password Not Required'
WHEN userAccountControl = 546 THEN 'Disabled, Password Not Required'
WHEN userAccountControl = 4096 THEN 'WORKSTATION_TRUST_ACCOUNT'
WHEN userAccountControl = 8192
THEN 'Server Trusted Account for Delegation'
WHEN userAccountControl = 524288
THEN 'Trusted Account for Delegation'
WHEN userAccountControl = 590336
THEN 'Enabled, User Cannot Change Password, Password Never Expires'
WHEN userAccountControl = 65536
THEN CONVERT (VARCHAR(48), 'Account will Never Expire')
WHEN userAccountControl = 66048
THEN 'Enabled and Does NOT expire Paswword'
WHEN userAccountControl = 66050
THEN 'Normal Account, Password will not expire and Currently Disabled'
WHEN userAccountControl = 66064
THEN 'Account Enabled, Password does not expire, currently Locked out'
WHEN userAccountControl = 8388608
THEN CONVERT (VARCHAR(48), 'Password has Expired')
WHEN userAccountControl = 16777728 THEN 'TRUSTED_TO_AUTH_FOR_DELEGATION'
WHEN userAccountControl = 16843264 THEN 'UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION'
ELSE CONVERT (VARCHAR(248), userAccountControl)
END )
Kind Regards
Jonas