Function to schedule restart

restartThis monday I had to schedule a restart on a fileserver that weren`t in a cluster, therefore it had to be restarted in the middle of the night. I always have a little trouble when I schedule restarts and have to use google to get it right with the program/script and add argument lines. I decided to create a function where I can specify date and time to schedule the restart. I also put in some other functions as regular expression that checks that date and time is in correct format, deletion of old task with same name, confirmation if you want to create the job and some pop-ups.

 

 

 

 

 

 

 

 

 

 

Set folder inheritance

 

folder

In the last blogg I wrote in how to find differens in source and target folder inheritance. Here is a scritpt to enable the inheritance on multiple folders listed in an csv-file. The acl.SetAccessruleProtection line only sets the flag and the you have to commit with set-acl, hopefully this will change in future versions.

Had to use google on this one because the strange way to implement this. http://richardspowershellblog.wordpress.com/2008/02/06/file-system-allow-inheritable-permissions-from-parent-to-propagate/

 

Compare folder inheritance

 

inheritanceIn the middle of file server-migration where we migrated hundreds of folders in to a new folder structure on another server we had to compare the folder inheritance since it on the old sever where randomized. We made this script that uses an import from an csv file we used to handle the copy jobs source and target. The csv looked like this:

Job;Source;Target
BUF01;N:\Groups\XX\BUF ADMINISTRATION;\\srv-fil05\Gemensam$\XX\Administration och nämnd
BUF02;N:\Groups\XX\EKONOMI;\\srv-fil05\Gemensam$\XX\Administration och nämnd

The script results in a file that displays all source paths that doesn´t compiles with the targets inheritance.