On Wed, Dec 28, 2011 at 3:17 PM, Michael Leone <[email protected]> wrote: > if ($User.userAccountControl -band $ADS_UF_NORMAL_ACCOUNT ) > The '-band' operator failed: Cannot convert the > "System.DirectoryServices.PropertyValueCollection" value of type > "System.DirectoryServices.PropertyValueCollection" to type > "System.Int32"..
Hmm. Well, for a bitwise operation to have any meaning, it has to be done against simple machine storage -- in this case, a 32-bit unsigned integer. That's why PoSh is trying to convert to an Int32. Apparently PoSh thinks $User.userAccountControl is a PropertyValueCollection and not an int, and doesn't know how to convert it. I was trying to make sense of http://msdn.microsoft.com/en-us/library/system.directoryservices.propertyvaluecollection.aspx when your next message came through. :-) -- Ben ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to [email protected] with the body: unsubscribe ntsysadmin
