Create remoting share folder
来源:互联网 发布:ps头像源码 编辑:程序博客网 时间:2024/05/17 01:45
$password= $ptfproppassWord
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$domain=$ptfpropdomainName
$userName=$ptfpropuserName
# create the credential for access to the sharepoint site
$credential = new-object Management.Automation.PSCredential(($domain+"/"+$userName),$securePassword)
$computerName = $ptfpropcomputerName
#make sure the path is end with the '/'
$sharedFolderPath = $ptfpropsharedFolderPath
if($sharedFolderPath.LastIndexOf('/') -ne $sharedFolderPath.length-1)
{
$sharedFolderPath = $sharedFolderPath + "/"
}
$sharedFolderName = $ptfpropsharedFolderName
$ret = invoke-command -computer $computerName -Credential $credential -scriptblock{
param(
[string]$sharedFolderPath,
[string]$sharedFolderName
)
$sharedFolderFullName = $sharedFolderPath + $sharedFolderName
$isHaveSameFolder = Test-Path $sharedFolderFullName
if($isHaveSameFolder -eq $false)
{
# Creat the shared directory
New-Item -path $sharedFolderPath -ItemType directory -Name $sharedFolderName
}
(Get-WmiObject -List -ComputerName . | Where-Object -FilterScript {$_.Name -eq "Win32_Share"}).InvokeMethod("Create",($sharedFolderFullName,$sharedFolderName,0,25,"Shared folder for the error reporting"))
} -argumentlist $sharedFolderPath, $sharedFolderName
if($? -eq $false)
{
throw $error[0]
}
- Create remoting share folder
- VirtualBox Share Folder配置
- virtual box share folder.
- vmware 共享文件夹(share folder)
- Win7 with Ubuntu15 share folder
- Perl create\remove folder
- 辛承龙:Think! Create! Share!
- create share(manila)
- [转]Virtualbox Share Folder的设置
- mount windows share folder on Centos
- setting virtualbox share folder in windows7 system
- PHP----Folder(create,delete,多级)
- Create groups 与 Create folder references
- Create groups 与 Create folder references
- Create folder and subfolder in Sharepoint
- How to create folder in github repository?
- could not create bundle folder at XXX
- How to share folder to windows from ubuntu with samba.
- ASP.net页面跳转的几种方法
- forward与sendRedirect区别
- 新人 支持支持啊
- 回文原来是这样的
- hibernate
- Create remoting share folder
- 【原创】图像颜色分布直方图设计[matlab]
- 海量数据的处理方案
- February 5th Friday 2010
- .chm文件打不开怎么办
- windows驱动分类
- 解决PHP中文乱码问题
- MyEclipse6.0集成SVN及配置详解
- 软件行业7条工作经验