Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to STOP MsGina (Event1010) Errors on TS?

Status
Not open for further replies.

1LUV1T

IS-IT--Management
Nov 6, 2006
231
US
I ran a .vbs file that stated this;
Sub GetParentDir
ParentDir = InputBox("Type the path of the parent folder for the user folders:", "Parent Directory Input Prompt", ParentDir)
If Not FS.FolderExists(ParentDir) Then
GetParentDir
End If
End Sub

Dim WSHNetwork, WSHShell, FS, Domain, DomainObj, Computer, ShareServiceObj, ParentDir, Hidden, Drive
Set FS = CreateObject("Scripting.FileSystemObject")
Set WSHNetwork = CreateObject("WScript.Network")
Set ShareServiceObj = GetObject("WinNT://" & WSHNetwork.ComputerName & "/LanManServer")

Domain = InputBox("Type the name of your domain:","Enumeration and Creation of User Shares","DomainName")
ParentDir = "C:\Users"
GetParentDir
Hidden = MsgBox("Do you want the user shares to be hidden? If yes, the share will be username$; If no, the share will be username", 4, "Hidden Shares?")
Hidden = Hidden - 7
Drive = InputBox("What drive letter do you want to map the home folder to?", "Drive Letter?", "X:")
Set DomainObj = GetObject("WinNT://" & Domain)
DomainObj.Filter = Array("User")

For Each UserObj in DomainObj
Dim ShareName
If Not FS.FolderExists(ParentDir & "\" & UserObj.Name) Then
FS.CreateFolder(ParentDir & "\" & UserObj.Name)
End If
ShareName = UserObj.Name
If Hidden Then
ShareName = ShareName & "$"
End If
On Error Resume Next
Set NewShare = ShareServiceObj.Create("fileshare", ShareName)
If Not Err Then
NewShare.Path = ParentDir & "\" & UserObj.Name
NewShare.MaxUserCount = 1 'Sets the limit for the number of user connections
NewShare.SetInfo
UserObj.HomeDirectory = "\\" & WSHNetwork.ComputerName & "\" & ShareName
UserObj.HomeDirDrive = Drive 'Requires ADSI 2.5
UserObj.SetInfo
End If
Next

MsgBox "Script Complete",, "Finished"

It messed something up for all my users in terms of their User Drive (U:/) disappearing or appearing incorrectly because when running the script I put U: for Drive = InputBox("What drive letter do you want to map the home folder to?", "Drive Letter?", "X:"). So now my Terminal Server is setting everyone that logs in with the wrong U:/ home folder (//termimalserver/home on U:/) does not exist. How do I stop the script from running? My terminal server does not have active directory and my Domain Controller does not issue any GPO for this script. So how is this vbs file executing from my Terminal Server to everyon?
 
The only solution was to remove Home directory from Profile Tabs in Active Directory. I guess that will resolve this issue but I'd still like to know how this .VBS script executed from Terminal Server was able to effect my Domain Controller (I am a Domain Admin though).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top