Terminé

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]")

Compétences : Script Shell, Programmation C#, Powershell, Architecture Logicielle, DNS

en voir plus : 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

Concernant l'employeur :
( 4 commentaires ) Medicine Hat, Canada

Nº du projet : #27842199

Décerné à:

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 Plus

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% CAD en 1 jour
(11 Commentaires)
3.4

5 freelances font une offre moyenne de 26 $ pour ce travail

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

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% CAD en 2 jours
(9 Commentaires)
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 Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% CAD en 1 jour
(4 Commentaires)
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 Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% CAD en 1 jour
(0 Commentaires)
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 Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% CAD en 2 jours
(0 Commentaires)
0.0