Hi Everyone,
I'm very new to Powershell. I'm trying to write a script that exports all Onenotebook URL's users have to a text file. Change part of the path save it then import it back to the registry. I'm having couple problems with this.
1- We use SCCM in our environment which uses "NT Authority\System" account when the scripts run. When I try to use that account (Using Psexec) Powershell gives me an error "Can't find the path" because it is looking under HKCU for the system account which doesn't have the onenote installed.
2- When I export the values (URL's) from the registry, Although I get the links, I also get the name "Values". Is there a way to just get the links and nothing else?
Value
-----
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents/
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents/
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents/
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents/
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents/
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents/
https://testtestetesteste.test.net/5834jlsdf34882d3d/^.Documents
The code I use to get this is :
Push-Location
Set-Location 'HKCU:\Software\Microsoft\Office\14.0\Onenote\opennotebooks'
Get-Item . | Select-Object -ExpandProperty Property | ForEach-Object {
New-Object PSobject -Property @{"property"=$_;"Value" = (Get-ItemProperty -Path . -Name $_).$_}} | Format-Table Value -AutoSize | Out-File $OneNoteBooks
Pop-LocationThank you everyone in advance for their answers.
-Fatih
BesiktASK