kxv2020 Posted September 9, 2008 Posted September 9, 2008 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. '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
altecsole Posted September 9, 2008 Posted September 9, 2008 What about: Set WshNetwork = WScript.CreateObject("WScript.Network") strComputer = WshNetwork.ComputerName strUser = WshNetwork.UserName
kxv2020 Posted September 9, 2008 Author Posted September 9, 2008 What about: Set WshNetwork = WScript.CreateObject("WScript.Network") strComputer = WshNetwork.ComputerName strUser = WshNetwork.UserName Would these replace the main bulk of code...?
altecsole Posted September 10, 2008 Posted September 10, 2008 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?
ajbritton Posted September 11, 2008 Posted September 11, 2008 Googled for AdSystemInfo and Vista... ADSystemInfo causes logon script to hang in Vista
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now