安装VMware后,设置WinRM

在windows7下需要执行这个脚本。windows 2008R2似乎是正常的。

 $nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))

$connections = $nlm.getnetworkconnections()
$connections |foreach {
    
if ($_.getnetwork().getcategory() -eq 0)
    {
        
$_.getnetwork().setcategory(1)
    }
}

再来一段,好像是一样的。嘿嘿。

$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$connections = $nlm.getnetworkconnections()
$connections |foreach {
    
if ($_.getnetwork().getcategory() -eq 0)
    {
        
$_.getnetwork().setcategory(1)
    }

} 

 

 

 

 

posted @ 2011-03-12 23:39  daweibalaomao  阅读(285)  评论(0编辑  收藏  举报