First off, I am OK with powershell but not anywhere close to an expert. Typically if I find code that is close I can make it work but sometimes like right now I get stuck. I am trying to do a few things in a script. We are migrating from Notes to Outlook (Finally) and I have a PS script that does all the required changes EXCEPT checking the notes.ini file for each user for “DontCheckDefaultMail” If not there write it, if there check the value if “1” leave it alone, of “0” change to “1”
here is the chunk of code I am trying to use but I am being prompted to “supply values for the following parameters: Process” Im at a loss as to what it is asking for.
This code is a combo of code from a couple different sources, so its 100% possible that its all goofed up What I an trying, and failing, to do is read through all user profiles and look for AppData\Local\IBM\Notes\data\notes.ini, If found read the INI file and look for “DontCheckDefaultMail”, what I need it to then do is… If not found add it with a value of “1”, if found and value is “1” leave it along, If value not “1” set it to “1”. I know my script currently doesnt do all of these items, but I can’t even get it to run currently.
$Destination = ‘C:\Users*\AppData\Local\IBM\Notes\data’
Get-ChildItem $Destination | ForEach-Object
{
$files = Get-ChildItem -Path “$Destination\notes.ini”
foreach ($file in $files)
{
#$newfilename = $file.fullname -replace “.ini”, “-2.ini”
Get-Content $file |
ForEach {
$_.Replace('DontCheckDefaultMail=0 ', 'DontCheckDefaultMail=1')
} | Out-File $file
}
}