how can i create similar script in powershell

Welcome Forums General PowerShell Q&A how can i create similar script in powershell

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #6380

    Points: 0
    Rank: Member

    by muzz at 2013-02-06 02:31:10

    Set ObjFso = CreateObject("Scripting.FileSystemObject")

    StrFileName = "C:\SCOM\Scripts\WOLFMonitoring\ErrorLog.txt"

    sConnectString = "Provider=SQLO.1;Integrated Security=SSPI;Data Source=GVLDEVSQL1;Initial Catalog=MOC"

    set oRS = CreateObject("ADODB.Recordset")

    oRS.Open "EXEC MOC.dbo.spDirectoryMonitors", sConnectString

    Do While Not oRs.EOF

    sRecID = oRS("RecID")

    sDescription = oRS("Description")

    sFolderPathUNC = oRS("FolderPath_UNC")

    sThresholdMins = oRs("ThresholdMins")

    dim fso: set fso = CreateObject("Scripting.FileSystemObject")

    dim folder:set folder = fso.getFolder(sFolderPathUNC)

    If folder.files.Count > 1 Then

    'wscript.echo ("more than one")

    by ArtB0514 at 2013-02-06 08:55:08

    Go to and search for VBScript.

    by muzz at 2013-02-06 15:19:31

    I didn't get any similar script on that link , could you navigate me

    by ArtB0514 at 2013-02-07 07:18:19

    I doubt that you're going to find a similar script. The VBScript links should give you guidance on converting VBScript to PowerShell. A similar search for "SQL" will help you with coding SQL connections and queries in PowerShell.

The topic ‘how can i create similar script in powershell’ is closed to new replies.