Search found 11479 matches

by jvierra
Sun Oct 03, 2010 3:54 am
Forum: VBScript
Topic: Noob Call PowerShell Function from VbScript
Replies: 3
Views: 1889

Noob Call PowerShell Function from VbScript

If you really need to do this with PowerShell then try it this way. # # OpenFileDialog.ps1 # Param([string]$initialDir="c:windowsmedia") [VOID][System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") $ofd= New-Object System.Windows.Forms.OpenFileDialog $ofd.initialDirectory = $initi...
by jvierra
Sat Oct 02, 2010 8:53 pm
Forum: VBScript
Topic: Noob Call PowerShell Function from VbScript
Replies: 3
Views: 1889

Noob Call PowerShell Function from VbScript

By th eway. You can easily launch PowerShell from VBScript but it is not really possible to send anything back from PowerShell.

You would be best off writinng everything in PowerSHell as it can do anything VBScript can do and do it with less code and easier.

by jvierra
Sat Oct 02, 2010 12:13 pm
Forum: VBScript
Topic: Start one service on multiple servers
Replies: 6
Views: 2451

Start one service on multiple servers

Here is how we read a file in VBScript

Code: Select all

	
Set fso = CreateObject("Scripting.FileSystemObject")
	
Set file = fso.OpenTextFile("servers.txt")
	
 
	
While Not file.AtEndOfStrem
	
     server = file.ReadLine()
	
     StartService server
	
Wend
	
by jvierra
Sat Oct 02, 2010 6:36 am
Forum: VBScript
Topic: Start one service on multiple servers
Replies: 6
Views: 2451

Start one service on multiple servers

Here is how to do this in PowerShell which is much easier and more reliable. $computers = Get-Content servers.txt $computers | ForEach-Object{      get-service termservice -computer $_ |           set-service -startuptype Manual -computer $_ |{                  $_.Start()                 $_.WaitForS...
by jvierra
Fri Oct 01, 2010 9:46 am
Forum: VBScript
Topic: Start one service on multiple servers
Replies: 6
Views: 2451

Start one service on multiple servers

Get a collection of servers from either a file of Active Directory and call the function once for each server.


Just make your code into a function.

by jvierra
Fri Oct 01, 2010 6:21 am
Forum: VBScript
Topic: adding Authenticated Users removing Everyone
Replies: 2
Views: 916

adding Authenticated Users removing Everyone

Here is a script that will help you inventory shares. GetShareSecurity "omega2", "print$" Function GetShareSecurity( computer, sharenname )     On Error Resume Next     Set wmiFileSecSetting = GetObject("winmgmts:" & computer & "rootcimV2:Win32_LogicalShareSecuritySetting.Name='"  & sharenname & "'"...
by jvierra
Fri Oct 01, 2010 3:45 am
Forum: Windows PowerShell
Topic: problem with remoting and UNC paths
Replies: 6
Views: 3173

problem with remoting and UNC paths

Administrator's Guide to Windows PowerShell Remoting
jvierra2010-10-01 10:46:35
by jvierra
Fri Oct 01, 2010 3:38 am
Forum: Windows PowerShell
Topic: problem with remoting and UNC paths
Replies: 6
Views: 3173

problem with remoting and UNC paths

To enable client-side SSP for winrm, run the following lines:Enable-WSManCredSSP -Role client -DelegateComputer * To enable server-side SSP for winrm:Enable-WSManCredSSP -Role server These can be set up with Group Policy. The midle man has to be a client and a server. http://blogs.msdn.com/b/powersh...
by jvierra
Fri Oct 01, 2010 3:21 am
Forum: Windows PowerShell
Topic: problem with remoting and UNC paths
Replies: 6
Views: 3173

problem with remoting and UNC paths

You have to set it up in AD. I have never tried scotch-hopping with WMF so I am nut sure what will happen . The script will probanly just report errors. If you connect a remote session rhen attempt a DIr to a remote machine you should get an errors that indicates that the remote resource is not foun...