⬆️ ⬇️

Scripts for lazy Windows admins

Being some time ago admin (lazy), wrote several scripts that automate the routine and allow even more lazy. I no longer do adminstration, but I post scripts, who can come in handy.



1. Auto-install a computer description locally and in AD



The company had a standard for the name of computers, something like COMPUTERxxxx (xxxx is a number), respectively Helpdesk was difficult by the name of a person to find a computer for initial diagnostics and remote connection, and explaining to an ordinary user how to determine the computer name took a lot of time. The solution came in the form of a script.





setcompdescr.zip

')

After starting, wool all the computers from the specified OU and sets the description depending on the logged in user.



* The script should run from the account, which has admin rights on computers and access to change the computer description in AD.

** Does not work correctly on Windows 2000, if the user logged in is not a local administrator, has not been tested with Windows Vista.



Before starting, you need to configure the script.



2. Auto-cleaning of the “sharing folder”



Each department in the company had its own folder, where other departments did not have access. For the exchange of information between departments (presentations, text, and music) were perverted as they could. I had to create a folder for sharing and a script, clearing it, so that the information does not lie there.



clear_exchange_v2s.zip



Script logic: files that have passed 10 days from the day of creation / modification are placed in the special folder inside the exchange folder (_deletion_queue_), then from the folder “to be deleted”, after 7 days, the files are deleted completely.



Everything is configured by variables in the script.



3. Redirect "Chosen"



Microsoft has provided a redirect of almost everything, except for the "Favorites". Why - a mystery. The company had a strict rule that all data was stored on servers. The loss of the “Chosen” is not, of course, fatal, but unpleasant. Therefore, I wrote a script that redirects the "Favorites" to a folder on the server.



redirect_facebook.zip



Ps. The scripts were written “for myself”, therefore, before use, set up and check for something unimportant :-)

Source: https://habr.com/ru/post/20443/



All Articles