Completed

Need help in powershell

I need help in powershell commands. the person should have deep knowledge of powershell. The project is not that long. I want the below command to search from list of servere from a file [login to view URL] and see if server exits and if it does not this command should send me email. The below command is not working and your job is to make it working

$usernamesend="**@gmail.**"

$From = "**@gmail.**"

$To = "**2@gmail.**"

$Cc = " "

$Subject = "$Server is not working"

$Body = "Insert body text here"

$SMTPServer = "[login to view URL]"

$SMTPPort = "587"

$secpasswd = ConvertTo-SecureString “emailpassword” -AsPlainText -Force

$cred = new-object [login to view URL] ($usernamesend,$secpasswd)

Function Test-Server {

[CmdletBinding()]

# Parameters used in this function

param

(

[Parameter(Position=0, Mandatory = $true, HelpMessage="Provide server names", ValueFromPipeline = $false)]

$ComputerName

)

$Array = @()

ForEach($Server in $ComputerName)

{

$Server = $[login to view URL]()

$SMB = $null

$Object = $null

$Status = $null

$SMB = Test-Path "\\$server\c$"

If($SMB -eq "True")

{

$Status = "True"

$Object = New-Object PSObject -Property ([ordered]@{

Server = $Server

"Is Online?" = $Status

})

$Array += $Object

}

Else

{

$Status = "False"

$Object = New-Object PSObject -Property ([ordered]@{

Server = $Server

"Is Online?" = $Status

Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential $Cred

})

$Array += $Object

}

}

If($Array)

{

return $Array

}

}

Test-Server -ComputerName (Get-Content "C:\temp\[login to view URL]")

Skills: Shell Script, C# Programming, Powershell, Software Architecture, DNS

See more: powershell commands, update-help powershell, get-command powershell, powershell add help to script, powershell get-help not working, get-help prefix, get-help command powershell, powershell help forum, mp3 files need help transcribing, need help adding google adsense site, freelance need help wsdl file, open source projects need help, need help text website, need help building resume, need help fixing cre loaded, coldfusion website need help, need help finishing work, need help design hair salon, need help mcafee secure vulnerabilities, need help cloning website

About the Employer:
( 4 reviews ) Medicine Hat, Canada

Project ID: #27842199

Awarded to:

kanwaljeetk56

Hi, I have already designed this kind of monitoring script to check after every interval if computer is not pinging then it will send an email alert to the configured email id. you can input all your windows servers More

$30 CAD in 1 day
(11 Reviews)
3.4

5 freelancers are bidding on average $26 for this job

MIGHTX

Hi, I work doing automation with powershell. I would like to participate in your project. please send me to chat to share details. regards

$30 CAD in 2 days
(9 Reviews)
3.6
Andrej126

Hi, Now,I understand what you want. I have source code to send email. So,I can resolve your problem quickly I am available full time for your project. Please send the message to discuss the more details. I will be wa More

$50 CAD in 1 day
(4 Reviews)
3.0
Junaid3100

I am full stack developer, had worked on php larvel, cake php, Javascript and Django. I have successful history in web development and web designing. I have developed multiple application and UI/UX and many logos and g More

$10 CAD in 1 day
(0 Reviews)
0.0
AbsarHN

I am a IT Infrastructure Service Delivery specialist , please check my profile for further details. Brief skill i have: KILLS AND COMPETENCIES TECHNICAL • IT Service Management • Service Level Management • Change and C More

$10 CAD in 2 days
(0 Reviews)
0.0