startrek133 Posted August 31, 2011 Author Share Posted August 31, 2011 well guys , it works thanks to a little help from my boss .. we got it working late last night .. thanks to everyone who helped !!!!! Link to comment Share on other sites More sharing options...
rcmaehl Posted August 31, 2011 Share Posted August 31, 2011 well guys , it works thanks to a little help from my boss .. we got it working late last night .. thanks to everyone who helped !!!!! May I see the final script? My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
startrek133 Posted August 31, 2011 Author Share Posted August 31, 2011 expandcollapse popupAutoItSetOption("MustDeclareVars", 1) #include <File.au3> #include <Array.au3> #include <String.au3> ;;;;;;;;;;;;;;;;; ;Define Variables ;;;;;;;;;;;;;;;;; Global $usrArray Global $i = 1 Global $file = "Usernames.txt" Global $domain = "domain" Global $server = "\\server" Global $profileFolder = "RProfile" Global $userAccount = "Users" Global $xcacls = "c:\xcacls.vbs" Global $pid Global $j, $TotalProcess, $EachProcess ;Progress meter variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Making of the folders from a txt file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _FileReadToArray($file, $usrArray) ;;;;;;;;;;;;;;; ;Progress Meter ;;;;;;;;;;;;;;; ProgressOn("Progress Meter", "Percentage Complete", "0 percent") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Define number of process based on number of users ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $TotalProcess = $usrArray[0]*4 ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Percentage of each process ;;;;;;;;;;;;;;;;;;;;;;;;;;; $EachProcess = Round((1/$TotalProcess)*100,0) ;;;;;;;;;;;;;;;;;;;;;;;;; ;First process percentage ;;;;;;;;;;;;;;;;;;;;;;;;; $j=$EachProcess For $i = 1 To $usrArray[0] ;;;;;;;;;;;;;;;;;;; ;Create User Folder ;;;;;;;;;;;;;;;;;;; DirCreate($server & "\" & $profileFolder & "\" & $usrArray[$i]) ProgressSet( $j, $j & " percent") $j=$j+$EachProcess ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Remove Inheritance but copy rights ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $pid=RunWait(@ComSpec & ' /c ' & $xcacls & ' "' & $server & '\' & $profileFolder & '\' & $usrArray[$i] & '" /I Copy', @WindowsDir, @SW_HIDE) ProgressSet( $j, $j & " percent") $j=$j+$EachProcess ;;;;;;;;;;;;;;;;;;;;;;;;;; ;Remove local User account ;;;;;;;;;;;;;;;;;;;;;;;;;; $pid=RunWait(@ComSpec & ' /c ' & $xcacls & ' "' & $server & '\' & $profileFolder & '\' & $usrArray[$i] & '" /E /T /R ' & $server & '\' & $userAccount, @WindowsDir, @SW_HIDE) ProgressSet( $j, $j & " percent") $j=$j+$EachProcess ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Add/Set permissions for domain user ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $pid=RunWait(@ComSpec & ' /c ' & $xcacls & ' "' & $server & '\' & $profileFolder & '\' & $usrArray[$i] & '" /E /T /G ' & $domain & '\' & $usrArray[$i] & ':F', @WindowsDir, @SW_HIDE) ProgressSet( $j, $j & " percent") $j=$j+$EachProcess Next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() Link to comment Share on other sites More sharing options...
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