+ Reply to Thread
Results 1 to 5 of 5

Thread: Accesss Denied Error VBS Login Script

  Share/Bookmark
  1. #1

    Reputation

    Join Date
    Apr 2006
    Location
    West Midlands
    Posts
    296
    Thank Post
    16
    Thanked 14 Times in 13 Posts
    Rep Power
    11

    Default Accesss Denied Error VBS Login Script

    Ok... A on a few occasions now when I logon to my vista machine I get an Access Denied error on VBS Script which is only mapping network drives and printers [800A0046] - of which the code is pasted below.

    I have full admin and domain rights and this only occurs on Vista - on XP it's not a problem.

    I use Roaming Profiles and deleting it and starting fresh seems to solve the problem a bit and then it reoccurs after a while.


    The error occurs on the second from last line.

    Code:
    'CONSTRUCTORS
    '----------------------------------------------
    Option Explicit
    
    Dim objNetwork, objSysInfo, strUserDN
    Dim objGroupList, objUser, objFSO
    Dim strComputerDN, objComputer
    Dim WshNetwork
    Dim UserName
    Dim ComputerName
    
    
    set Wshnetwork = CreateObject("WScript.Network")
    
    Set objNetwork = CreateObject("Wscript.Network")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objSysInfo = CreateObject("ADSystemInfo")
    
    
    strUserDN = objSysInfo.userName
    
    
    'ERROR HERE LINE 44 BELOW!!>>>>>>>>>>>>>>>>>>
    strComputerDN = objSysInfo.computerName
    
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    
    etc...

    Any help greatly appreciated! Thanks

  2. #2

    Reputation
    altecsole's Avatar
    Join Date
    Jun 2005
    Location
    Lancaster, Lancashire, UK.
    Posts
    256
    Thank Post
    27
    Thanked 24 Times in 20 Posts
    Rep Power
    13

    Default

    What about:

    Set WshNetwork = WScript.CreateObject("WScript.Network")
    strComputer = WshNetwork.ComputerName
    strUser = WshNetwork.UserName

  3. #3

    Reputation

    Join Date
    Apr 2006
    Location
    West Midlands
    Posts
    296
    Thank Post
    16
    Thanked 14 Times in 13 Posts
    Rep Power
    11

    Default

    Quote Originally Posted by altecsole View Post
    What about:

    Set WshNetwork = WScript.CreateObject("WScript.Network")
    strComputer = WshNetwork.ComputerName
    strUser = WshNetwork.UserName
    Would these replace the main bulk of code...?

  4. #4

    Reputation
    altecsole's Avatar
    Join Date
    Jun 2005
    Location
    Lancaster, Lancashire, UK.
    Posts
    256
    Thank Post
    27
    Thanked 24 Times in 20 Posts
    Rep Power
    13

    Default

    Quote Originally Posted by kiran View Post
    Would these replace the main bulk of code...?
    Do you want the distinguished name for the computer and user, or just the short name?

    The code you posted retrieves the dn and works fine for me. What error message do you get?

  5. #5

    Reputation Reputation Reputation Reputation
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,630
    Thank Post
    17
    Thanked 73 Times in 43 Posts
    Rep Power
    26

    Default

    Googled for AdSystemInfo and Vista...

    ADSystemInfo causes logon script to hang in Vista

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Photostory Access denied error.
    By ICT_GUY in forum Windows
    Replies: 20
    Last Post: 10-02-2010, 11:03 AM
  2. vbs overflow error
    By strawberry in forum Scripts
    Replies: 5
    Last Post: 04-09-2008, 10:31 AM
  3. Sub within a sub - VBS Script
    By FN-GM in forum Scripts
    Replies: 5
    Last Post: 18-05-2008, 06:30 PM
  4. VBS Script to copy a folder
    By FN-GM in forum Scripts
    Replies: 2
    Last Post: 23-02-2008, 01:08 PM
  5. Trace a VBS Script
    By chalkwellstu in forum Scripts
    Replies: 3
    Last Post: 25-01-2008, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts