Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Modify User Account - Smart Card is required

HTVi
TV Discussion Newsgroups

Modify User Account - Smart Card is required
Rob 6/26/2007 3:38:01 PM
We are about to rollout Certificates. Does anyone have a script or can point
me to one that modify's an existing users account "smart card is required for
interactive logon"
I really don't want to have to modify manually.
Re: Modify User Account - Smart Card is required
"Richard Mueller [MVP]" <rlmueller-nospam[ at ]ameritech.nospam.net> 6/26/2007 5:08:31 PM
Rob wrote:

[Quoted Text]
> We are about to rollout Certificates. Does anyone have a script or can
> point
> me to one that modify's an existing users account "smart card is required
> for
> interactive logon"
> I really don't want to have to modify manually.

A bit of the userAccountControl attribute determines this. To set this bit
for one user, you Or the attribute value with the appropriate bit mask:
==================
Const ADS_UF_SMARTCARD_REQUIRED = &H40000

' Bind to user object.
Set objUser = GetObject("LDAP://cn=Jim Smith,ou=Sales,dc=MyDomain,dc=com")
' Retrieve value of userAccountControl.
lngFlag = objUser.userAccountControl
' Set bit for smartcard required.
lngFlag = lngFlag Or ADS_UF_SMARTCARD_REQUIRED
' Assign new value.
objUser.userAccountControl = lngFlag
' Save changes.
objUser.SetInfo
=================

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen