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: Trouble with login script

HTVi
TV Discussion Newsgroups

Trouble with login script
"Dave" <junk[ at ]junkmail.com> 5/22/2007 1:01:48 AM
I am having trouble figuring this out, could someone help me. I wouldn't
doubt that I way out in left field.

Any help would be appreciated,
Dave

\\SERVER\Clients\Setup\setup.exe /s SERVER

Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser
strUserName = objUser.samAccountName
strOUPath = objUser.Parent
arrContainers = Split(strOUPath, ",")
arrOU = Split(arrContainers(0), "=")
strOU = arrOU(1)
set objNetwork = CreateObjects("Wscript.Network")

objNetwork.MapNetworkDrive "M:", "\\Server\Music"
objNetwork.MapNetworkDrive "P:", "\\Server\Pictures"
objNetwork.MapNetworkDrive "S:", "\\Server\Shared Folders"

If CurrentUser = "Adrianna" Then

objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff"
objNetwork.MapNetworkDrive "I:", "\\Server\Downloads"
objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks"

ElseIf CurrentUser = "Dave" Then

objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff"
objNetwork.MapNetworkDrive "I:", "\\Server\Downloads"
objNetwork.MapNetworkDrive "K:", "\\Server\ClientApps"
objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks"
objNetwork.MapNetworkDrive "J:", "\\Server\Dave's Stuff"
objNetwork.MapNetworkDrive "Q:", "\\Server\RIS"
objNetwork.MapNetworkDrive "R:", "\\Server\RemoteInstall"
objNetwork.MapNetworkDrive "T:", "\\Server\Misc Text Files"
objNetwork.MapNetworkDrive "V:", "\\Server\Dave's Programming Stuff"
objNetwork.MapNetworkDrive "W:", "\\Server\Web Sites"
objNetwork.MapNetworkDrive "Z:", "\\Server\System Backups"

ElseIf CurrentUser = "Administrator" Then

objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff"
objNetwork.MapNetworkDrive "I:", "\\Server\Downloads"
objNetwork.MapNetworkDrive "K:", "\\Server\ClientApps"
objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks"
objNetwork.MapNetworkDrive "J:", "\\Server\Dave's Stuff"
objNetwork.MapNetworkDrive "Q:", "\\Server\RIS"
objNetwork.MapNetworkDrive "R:", "\\Server\RemoteInstall"
objNetwork.MapNetworkDrive "T:", "\\Server\Misc Text Files"
objNetwork.MapNetworkDrive "V:", "\\Server\Dave's Programming Stuff"
objNetwork.MapNetworkDrive "W:", "\\Server\Web Sites"
objNetwork.MapNetworkDrive "Z:", "\\Server\System Backups"

ElseIf CurrentUser = "Other" Then

objNetwork.MapNetworkDrive "H:", "\\Server\Household Stuff"
objNetwork.MapNetworkDrive "I:", "\\Server\Downloads"
objNetwork.MapNetworkDrive "K:", "\\Server\ClientApps"
objNetwork.MapNetworkDrive "L:", "\\Server\Educational Disks"
objNetwork.MapNetworkDrive "J:", "\\Server\Dave's Stuff"
objNetwork.MapNetworkDrive "Q:", "\\Server\RIS"
objNetwork.MapNetworkDrive "R:", "\\Server\RemoteInstall"
objNetwork.MapNetworkDrive "T:", "\\Server\Misc Text Files"
objNetwork.MapNetworkDrive "V:", "\\Server\Dave's Programming Stuff"
objNetwork.MapNetworkDrive "W:", "\\Server\Web Sites"
objNetwork.MapNetworkDrive "X:", "\\Server\Other Stuff"
objNetwork.MapNetworkDrive "Z:", "\\Server\Educational Disks"

End If

Re: Trouble with login script
"Marty List" <usenet[ at ]optimumx.com> 5/22/2007 1:40:15 AM

Did you forget to include your question?


Re: Trouble with login script
"Dave" <junk[ at ]junkmail.com> 5/22/2007 1:54:30 AM
I am wondering what is wrong with this code.

Thanks,
Dave


"Marty List" <usenet[ at ]optimumx.com> wrote in message
news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com...
[Quoted Text]
>
> Did you forget to include your question?
>
>

Re: Trouble with login script
"Marty List" <usenet[ at ]optimumx.com> 5/22/2007 4:40:30 AM

Most people would be helpful and post the error messages, which lines are
failing. You want others to do more work than is necessary because you're
not willing to post specific questions.


- This line is missing a right parenthesis ")":
Set objUser = GetObject("LDAP://" & strUser


- These lines seems irrelevant/unnecessary:
strOUPath = objUser.Parent
arrContainers = Split(strOUPath, ",")
arrOU = Split(arrContainers(0), "=")
strOU = arrOU(1)


- Replace all occurrences of "CurrentUser" with "strUserName", for example
this line:
If CurrentUser = "Adrianna" Then
should be:
If strUserName = "Adrianna" Then



"Dave" <junk[ at ]junkmail.com> wrote in message
news:%23$WJCRBnHHA.4960[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
>I am wondering what is wrong with this code.
>
> Thanks,
> Dave
>
>
> "Marty List" <usenet[ at ]optimumx.com> wrote in message
> news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com...
>>
>> Did you forget to include your question?
>>
>>
>

Re: Trouble with login script
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 5/22/2007 6:34:58 AM

"Marty List" <usenet[ at ]optimumx.com> wrote in message
news:94AE6958-FD10-47E2-A560-DA2B6EB377EB[ at ]microsoft.com...
[Quoted Text]
>
> Most people would be helpful and post the error messages, which lines are
> failing. You want others to do more work than is necessary because you're
> not willing to post specific questions.
>
>
> - This line is missing a right parenthesis ")":
> Set objUser = GetObject("LDAP://" & strUser
>
>
> - These lines seems irrelevant/unnecessary:
> strOUPath = objUser.Parent
> arrContainers = Split(strOUPath, ",")
> arrOU = Split(arrContainers(0), "=")
> strOU = arrOU(1)
>
>
> - Replace all occurrences of "CurrentUser" with "strUserName", for example
> this line:
> If CurrentUser = "Adrianna" Then
> should be:
> If strUserName = "Adrianna" Then

Also, I suspect that this statement:

ElseIf CurrentUser = "Other" Then

should probably be replaced with this one:

Else

Unless, of course, there actually is a user whose name is "Other".


/Al

>
>
>
> "Dave" <junk[ at ]junkmail.com> wrote in message
> news:%23$WJCRBnHHA.4960[ at ]TK2MSFTNGP02.phx.gbl...
>>I am wondering what is wrong with this code.
>>
>> Thanks,
>> Dave
>>
>>
>> "Marty List" <usenet[ at ]optimumx.com> wrote in message
>> news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com...
>>>
>>> Did you forget to include your question?
>>>
>>>
>>
>


Re: Trouble with login script
Dave Marden 5/22/2007 3:27:01 PM
My bad Marty, I am used to Visual Basic and have never posted on this site
before. I will try out the changes you mention and repost with any errors I
find later tonight. I will be sure to include all error messages at that
time.

Dave Marden


"Marty List" wrote:

[Quoted Text]
>
> Most people would be helpful and post the error messages, which lines are
> failing. You want others to do more work than is necessary because you're
> not willing to post specific questions.
>
>
> - This line is missing a right parenthesis ")":
> Set objUser = GetObject("LDAP://" & strUser
>
>
> - These lines seems irrelevant/unnecessary:
> strOUPath = objUser.Parent
> arrContainers = Split(strOUPath, ",")
> arrOU = Split(arrContainers(0), "=")
> strOU = arrOU(1)
>
>
> - Replace all occurrences of "CurrentUser" with "strUserName", for example
> this line:
> If CurrentUser = "Adrianna" Then
> should be:
> If strUserName = "Adrianna" Then
>
>
>
> "Dave" <junk[ at ]junkmail.com> wrote in message
> news:%23$WJCRBnHHA.4960[ at ]TK2MSFTNGP02.phx.gbl...
> >I am wondering what is wrong with this code.
> >
> > Thanks,
> > Dave
> >
> >
> > "Marty List" <usenet[ at ]optimumx.com> wrote in message
> > news:B5E6070E-C72A-419F-9BD0-ECA14C16E029[ at ]microsoft.com...
> >>
> >> Did you forget to include your question?
> >>
> >>
> >
>

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