Scripts Thread, Sharing folder on remote server in Coding and Web Development; I've got an AutoIT script that creates new users and on our old server 2003 server it would also use ...
-
12th September 2011, 12:04 PM #1 Sharing folder on remote server
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)
-
-
IDG Tech News
-
12th September 2011, 02:39 PM #2 got it sorted, not quite sure how but it started working, so ignore this
-
SHARE: 
Similar Threads
-
By BKGarry in forum How do you do....it?
Replies: 9
Last Post: 29th July 2009, 08:32 AM
-
By fred54 in forum Windows
Replies: 3
Last Post: 12th December 2007, 08:52 AM
-
By tosca925 in forum Windows
Replies: 6
Last Post: 20th October 2005, 06:48 PM
-
Replies: 20
Last Post: 12th September 2005, 04:52 PM
-
By ninjabeaver in forum Windows
Replies: 24
Last Post: 6th September 2005, 12:26 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules