+ Post New Thread
Results 1 to 5 of 5
Windows Vista Thread, Accesss Denied Error VBS Login Script in Technical; Ok... A on a few occasions now when I logon to my vista machine I get an Access Denied error ...
  1. #1

    Join Date
    Apr 2006
    Location
    West Midlands
    Posts
    314
    Thank Post
    29
    Thanked 19 Times in 18 Posts
    Rep Power
    21

    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
    altecsole's Avatar
    Join Date
    Jun 2005
    Location
    Whittington, Lancashire
    Posts
    286
    Thank Post
    40
    Thanked 37 Times in 27 Posts
    Rep Power
    26
    What about:

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

  3. #3

    Join Date
    Apr 2006
    Location
    West Midlands
    Posts
    314
    Thank Post
    29
    Thanked 19 Times in 18 Posts
    Rep Power
    21
    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
    altecsole's Avatar
    Join Date
    Jun 2005
    Location
    Whittington, Lancashire
    Posts
    286
    Thank Post
    40
    Thanked 37 Times in 27 Posts
    Rep Power
    26
    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
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    35
    Googled for AdSystemInfo and Vista...

    ADSystemInfo causes logon script to hang in Vista



SHARE:
+ Post New Thread

Similar Threads

  1. Photostory Access denied error.
    By ICT_GUY in forum Windows
    Replies: 20
    Last Post: 10th February 2010, 12:03 PM
  2. vbs overflow error
    By strawberry in forum Scripts
    Replies: 5
    Last Post: 4th September 2008, 11:31 AM
  3. Sub within a sub - VBS Script
    By FN-GM in forum Scripts
    Replies: 5
    Last Post: 18th May 2008, 07:30 PM
  4. VBS Script to copy a folder
    By FN-GM in forum Scripts
    Replies: 2
    Last Post: 23rd February 2008, 02:08 PM
  5. Trace a VBS Script
    By chalkwellstu in forum Scripts
    Replies: 2
    Last Post: 25th January 2008, 11:53 AM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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