[] to create a network share
PS> (Get-WmiObject -List -ComputerName . | Where-Object -FilterScript {$_.Name -eq "Win32_Share"}).Create("C:\temp","TempShare",0,25,"test share of the temp folder")
[] to remove a network share
PS> (Get-WmiObject -Class Win32_Share -ComputerName . -Filter "Name='TempShare'").Delete()
[] to create a new networked drive that maps the share \\FPS01\users to local drive B:
PS> (New-Object -ComObject WScript.Network).MapNetworkDrive("B:", "\\FPS01\users")
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment