AD Logon Hours

http://msdn.microsoft.com/en-us/library/ms180833(vs.80).aspx 

 

http://www.activexperts.com/activmonitor/windowsmanagement/scripts/activedirectory/user/retrieving/#ListAllowed.htm

 

PS C:\> [byte[]]$hours = @(0,0,0,0,255,3,0,255,3,0,255,3,0,255,3,0,255,3,0,0,0)
PS C:\> # create a hashtable to update the logon hours and a description
PS C:\> $replaceHashTable = New-Object HashTable
PS C:\> $replaceHashTable.Add("logonHours", $hours)
PS C:\> $replaceHashTable.Add("description", "Logon M-F from 8:00 AM to 6:00 PM")
PS C:\> Set-ADUser "StevieWonder" -Replace $replaceHashTable

 

 objUser.Properties["msNPAllowDialin"].Add(true);

 

posted @ 2012-06-27 00:57  hishanghai  阅读(361)  评论(0编辑  收藏  举报