MK-2 Posted September 12, 2011 Posted September 12, 2011 I've got an AutoIT script that creates new users and on our old server 2003 server it would also use WMI to share their home folder. Since we upgraded to 2008 r2 I've tried running the script again and it does everything apart from sharing the folder on the server. it uses the win32_process command which i've read should still work on 64 bit servers. this is the command, which worked on server 2003 but no longer works, can anyone see why it doesn't? $FILE_SHARE=0 $MAXIMUM_CONNECTIONS=-1 $objWMIService = objGet("winmgmts:\\" & $datacomp & "\root\cimv2:Win32_Process") $Locator=ObjCreate("WbemScripting.SWbemLocator") $objWMIService = $Locator.ConnectServer($datacomp, "\root\CIMV2") $objNewShare = $objWMIService.Get("Win32_Share") $objNewShare.Create('"' & "F:\Home Directories\Junior Pupils\" & $username & '"', $username & "$", $FILE_SHARE, $MAXIMUM_CONNECTIONS, "Share for " & $username)
MK-2 Posted September 12, 2011 Author Posted September 12, 2011 got it sorted, not quite sure how but it started working, so ignore this
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