How to import-csv from Onenote?

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 3 years, 5 months ago.

  • Author
  • #22355

    Daniel Brooks

    Here's the scenario. I've created a script to ping a CSV of servers and alert which servers are offline. Normally, I have it pull the list from my desktop, but we use a shared IT notebook that i've imported the CSV into that I'd like it to pull from instead since we're constantly updating server information.

    Here's what I have so far:

    $ServerList = Import-Csv -Path C:\users\AlertPC\desktop\ip.csv -Header "Name","Description","Ipaddress"
    foreach ($s in $ServerList) {
    If (!(Test-Connection -ComputerName $s.Name -Quiet -Count 1)) {
    Write-Host -foregroundcolor "green" "$PCName went Offline on $date"
    $date = Get-Date -format F
    $PCName = $s.Name
    $PCDescription = $s.Description
    $PCIpaddress = $s.Ipaddress
    $msSam = New-Object -ComObject SAPI.SPVoice
    $msSam.Speak("$PCDescription went offline")
    Write-Host -foregroundcolor "red" "Double-check your code. Something broke."
    Start-Sleep -Seconds 5

  • #22357

    Don Jones

    I'm not aware of an API to extract information from OneNote.

    It might make more sense to put this information into an actual database, like SQL Server Express, which is designed for data insert/update/query. OneNote isn't really a database.

You must be logged in to reply to this topic.