Hi, Please can someone help me with this as I am really stuck!
For my code above I am receiving the following:
Line 36, Char 6, Error: Permission denied.
Line 36 is the line that deletes the "userdata" : objFSO.DeleteFolder(strUserData)
It echoes me back telling me which userdata it wants to...
Hi again.
I'm really in a mess with this one. I found 2 problems, please see below:
1. I am receiving the following error:
Line 36, Char 6, Error: Permission denied.
Line 36 is the line that deletes the "userdata" : objFSO.DeleteFolder(strUserData)
It echoes me back telling me which userdata it...
Hi PHV man, thanks for your advice, on the takeown /? there is a parameter /A that allows me to take ownership as administrator.
I put this in front of the /F and it seems to take ownership as administrator.It seems to have done the trick!
I will further test this tomorrow to delete batches of...
Hi PHV, thank you for your quick response. Do I just add /U /P switches after the TAKEOWN command like the line below:
wshShell.Run "CMD /K TAKEOWN /F /U /P """ & strUserData & """ /R /D Y", 1, True
Is this correct? Please may you confirm this as I am unsure of this. Many thanks.
Hi PHV and Geates. Thank you both for your help on this.
Geates, i'm sorry but I made a mistake. "Line 45, error: access denied" is refering to:
objFSO.DeleteFolder(strUserData)
and this line is suppose to delete the "profile folder" and NOT the "userdata folder" so my apologies for my mistake...
Hi PHV,
I'm not sure whats happened man, but when I run the script now, the command line interface will come up and I receive the following error:
''\\rcmutility\software\VB SCRIPT\Script to delete STUDENT AD accounts, profiles
and userdata'
CMD.EXE was started with the above path as the...
Thank you or your response PHV. I will try this as I am back in work tomorrow (I was working on this script all evening today). I'm a junior programmer, so Im not sure how to use WScript.Echo
May you give me an example? Many thanks!
Hi, I want to start this as a new thread as I spent many hours and still couldn't work this one out.
The script below deletes all the userprofiles and userdata of all those accounts in a specified AD OU.
However I login to the File server that contains all the user profiles and userdata and run...
Hi Everyone,
Just to let you know that this is now finally sort (not the first time I said this, but lets hope this is final time)
I found out the reason why it isn't taking ownership is because the "profilepath" field in AD is not always specified in AD or is specified incorrectly with the...
Hi guitarzan,
Thank you for your extremely helpful advice.
I have done what you said.
Please see below answers to your questions
1. I login to the server that contains all the user profiles and userdata.
2. The script says "permission denied" and tells me which userdata my permission is...
Dear Sir/Madam,
unfortunately no one has responded to me yet but I am still having issues :(
When I run the script that Phylum has kindly written for me, I receive continuous error loops that does end that say the following:
Error 70 occurred while trying to 'objFSO.DeleteFolder...
Hi Phylum,
Ahhh, my apologies but I think I spoke too soon.. I have amended your script so it "Does not delete the user object from AD." I simply just remove that section from the script so it keeps the object in AD.
But now I am getting continuous error loop that doesn't end saying:
Error...
Hi Phylum,
I would just like to say from what I test so far, it works like a gem! Thank you so much for all your time on assisting me, I really appreciate this. Happy Chinese New year to you too! Fong
Hi again PH, When I run the script and the command prompt, it only takes ownership permission of "one" of the profile folders. I want it to take permission of "all" the profile folders that have their AD account in the "student leavers" OU. please may you assist
Hi PH, thanks but I am still receiving the error permission is denied. I am not sure why this is because I have checked the properties of the folder and can see I have taken ownership permission of the folder.
Im not sure shy I am still receiving this permission denied error
Thanks PH, the command prompt started running and I can see I have taken ownership of one of the profile folders! But now it does not run the next line of script to delete this profile. It does not loop around. Many thanks for this step, but can you help fix this. Fong
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.