Собственно для себя в мемориз!
Информация о пользователе
ON ERROR RESUME NEXT
Dim strUserDN, objSysInfo
set WshShell = CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objSysInfo = CreateObject("ADSystemInfo")
LogonServer=WshShell.ExpandEnvironmentStrings("%LogonServer%")
MsgBox "Logon server: " & LogonServer
strUserDN = objSysInfo.userName
MsgBox strUserDN
Set UserObj = GetObject("LDAP://" & strUserDN)
MsgBox "User '" & WshNetwork.username & "' connect to " & WshNetwork.computername
'Init Groups
Dim UserGroups
Dim GroupObj
UserGroups=""
For Each GroupObj In UserObj.Groups
UserGroups=UserGroups & "[" & GroupObj.Name & "]"
Next
MsgBox "Member of "& UserGroups
Function InGroup(strGroup)
InGroup=False
If InStr(UserGroups,"[" & strGroup & "]") Then
InGroup=True
End If
End Function
СОДАНИЕ ПАПКИ
Dim objFSO, objFolder, objShell, strDirectory
strDirectory = "C:1"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strDirectory) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFolder = objFSO.CreateFolder(strDirectory)
End If
Раздача прав
objShell.Run("%COMSPEC% /c Echo Y| cacls """ _
& strDirectory & """ /t /c /g " & WshNetwork.username & ":F administrator:F SYSTEM:F directorate:F ", 2, True)
http://sysadmins.ru/topic192982.html