Sign in to follow this  
Followers 0
savj14

Is this Possible?

5 posts in this topic

Here is the story.......We are migrating from Novell to Windows Server in a couple months. Right now I am working on a script for Users to run to join them to the domain.

Right now All Users are created as an administrator. What I would like to do is Join the computer to the domain and deleted all User Accounts except for the Administrator. I would like to change the Password for the administrator on each machine the script is run on. And add the administrator account if it the User happened to delete the administrator account.

That way the User will never be able to login to the local machine and make changes or have administrator privileges. I suppose I could add the user to the Power User Group if needed.

Now the problem lies here. When the user runs the script, how will they be able to delete their own account while they are still logged in?

Maybe if the script could:

  • Change the Administrator password/Adds the account if it doesw not exist.
  • Log off the Current User(So I can delete the current logged in user)
  • Automatically logs in with Administrator and the password I just changed it to(IS THIS POSSIBLE)
  • Continue to Run the Script
  • Delete All Users Except the Administrator
  • Proceed with Joing the Computer to the domain.
That should make it so the user can only login with the Domain Account. Not sure what will happen when they are at Home though since their local acocunt is now deleted.

Any thoughts on this??? Good or Bad??

Share this post


Link to post
Share on other sites



Here is the story.......We are migrating from Novell to Windows Server in a couple months. Right now I am working on a script for Users to run to join them to the domain.

Right now All Users are created as an administrator. What I would like to do is Join the computer to the domain and deleted all User Accounts except for the Administrator. I would like to change the Password for the administrator on each machine the script is run on. And add the administrator account if it the User happened to delete the administrator account.

That way the User will never be able to login to the local machine and make changes or have administrator privileges. I suppose I could add the user to the Power User Group if needed.

Now the problem lies here. When the user runs the script, how will they be able to delete their own account while they are still logged in?

Maybe if the script could:

  • Change the Administrator password/Adds the account if it doesw not exist.
  • Log off the Current User(So I can delete the current logged in user)
  • Automatically logs in with Administrator and the password I just changed it to(IS THIS POSSIBLE)
  • Continue to Run the Script
  • Delete All Users Except the Administrator
  • Proceed with Joing the Computer to the domain.
That should make it so the user can only login with the Domain Account. Not sure what will happen when they are at Home though since their local acocunt is now deleted.

Any thoughts on this??? Good or Bad??

It's can all be done with the possible exception of #5 although I think even that will work. I have most of the code available in VBS (and probably JS) but you will have to do the AutoIt conversion yourself. Do a search for VB2Aut in example scripts. I also have a version of that that fixes the Do/Until loops.

PM me for the VB code if you want it.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thanks for the link. I will have to look into this further tomorrow.

How might I start a Script which will force the User to Logoff, and then at the login prompt have an auto login, pickup the script where it left off(or run a new script if easier)

It seems as though once a User Logs off the script would be terminated, so it doesn't sound possible to me..... I could be wrong though

Share this post


Link to post
Share on other sites

Create a registry entry to a second script in the RunOnce key

$Key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
$App = @TempDir & "\MyScript.Exe"
RegWrite($Key,"MyApp",$App)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Well after some long searching I found something that will rid me of having to worry about removing Users and such to do what I need.

I am looking to do something similar to this:

http://www.lavalys.com/products/overview.php?pid=5&ps=CE&lang=en ://http://www.lavalys.com/products/ove...CE&lang=en ://http://www.lavalys.com/products/ove...CE&lang=en ://http://www.lavalys.com/products/ove...CE&lang=en ://http://www.lavalys.com/products/ove...CE&lang=en

It is a Nice Application, that is pretty much an all in one.

Is there something out there similar that is Free/Less Expensive?? Or is something possible to achieve using a Script?

If not maybe I can convince my Company to purchase this

Edited by savj14

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0