none
Need the Out-Put of this Powershell Script in CSV RRS feed

  • Question

  • I have this powershell script which imports FQDN from a csv files and automates deployment of agents on WINDOWS.

    I'm running SCOM-2016

    cls
    #Imports PowerShell Modules 
    
    import-module OperationsManager
    
    
    #Variables
    
    $InstallAccount = Get-Credential <credentials>
    $PrimaryMgmtServer = Get-SCOMManagementserver -Name <PrimaryManagementServer>
    
    
    #Connects to OpsMgr Management Group
    Start-OperationsManagerClientShell -ManagementServerName: <ManagementServerName> -PersistConnection: $true -Interactive: $true;
    
    $list = Import-Csv -Path 'C:\q\new.csv'
    
    foreach ($entry in $list)
        { 
    $computer = $entry.ServerName
    
        try
    {
        Install-SCOMAgent -Name $computer -PrimaryManagementServer $PrimaryMgmtServer -ActionAccount $InstallAccount -ErrorAction Stop
    #Writes Success message into file
    Write-Host -ForegroundColor Green  "Successfully Deployed On $computer.";
    "$computer, Success." | out-file "C:\q\new111.csv" -Append -NoClobber
            }
    
        Catch
    {
    #Writes a failure message into file
    Write-Host -ForegroundColor Red  "Failed On $computer.";
            "$computer, Failed." | out-file "C:\q\result.csv" -Append -NoClobber
    }
    
    }

    I want a similar one for Linux.

    Thank You
    Tuesday, August 27, 2019 12:08 PM

All replies