Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
If right(lcase(wscript.fullname),11) <> "cscript.exe" Then
MsgBox "This script must be run using cscript.exe",0,"Real administrators use the keyboard"
WScript.Quit
End If
Dim oRootDSE, oOU, oGroup, oGroupName
Dim sOU, sGroupName, sLongGroupName, sDNSDomain
Dim oFSIn, oTSIn, oFSOut, oTSOut
Dim sInFile, sOutFile
' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' Edit to suit
' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
sOU = "OU=HQ,OU=SR," ' Note trailing comma
sInFile = "hqGroups.txt"
sOutFile = "hqGroups.log"
' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Set oFSIn = CreateObject("Scripting.FilesystemObject")
Set oTSIn = oFSIn.OpenTextFile(sInFile)
Set oFSOut = CreateObject("Scripting.FilesystemObject")
Set oTSOut = oFSOut.CreateTextFile(sOutFile, True)
Set oRootDSE = GetObject("LDAP://RootDSE")
sDNSDomain = oRootDSE.Get("DefaultNamingContext")
Do Until oTSIn.AtEndOfStream
sGroupName = trim(oTSIn.ReadLine)
if len(sGroupName) > 0 then
sLongGroupName = "CN=" & sGroupName
Set oOU = GetObject("LDAP://" & sOU & sDNSDomain)
Set oGroup = oOU.Create("Group", sLongGroupName)
oGroup.Put "sAMAccountName", sGroupName
oGroup.setInfo
oTSOut.WriteLine(sGroupName & " created")
end if
Loop
' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' Clean Up
' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Set oRootDSE = Nothing
Set oFSIn = Nothing
Set oFSOut = Nothing
Set oOU = Nothing
Set oGroupName = Nothing
oTSIN.Close
oTSOut.Close