首页 » Visual Basic » VB怎样导入组策略并启用IP安全策略

VB怎样导入组策略并启用IP安全策略

'从文件导入策略到证书存储。跟上ipsec文件即可。
retCode = Shell("c:\WINDOWS\netsh.exe ipsec static importpolicy ""C:\myfire.ipsec""", vbHide)
'更改现存策略和相关信息。也就是说启用某个策略,填名字。
retCode = Shell("c:\WINDOWS\netsh.exe ipsec static set policy name=""myfire"" assign=y", vbHide)
'最后可以用这个来刷新组策略,理论上不用刷的,即时生效 
retCode = Shell("gpupdate.exe /force",vbHide)

, , ,

转发到新浪微博 转发到新浪微博

目前这篇文章有1条评论(Rss)

  1. Android Games | #1
    05/16/2012 at 17:46

    VB怎样导入组策略并启用IP安全策略 | 虚拟主机教程 Very nice post. I just stumbled upon your blog and wished to say that I have really enjoyed surfing around your blog posts. In any case I will be subscribing to your rss feed and I hope you write again soon!

我要评论