Open VectorBCO opened 4 years ago
Do you have an examples how to run this from SCCM? I am interesting to know invoke-command also.
Can you respond to my question please?
Unfortunately right now I do not have SCCM right now, so have no chance prepare exact scenario but in general it looks like this:
This sample described in Example 2 and here
ServicesFix log said it need to use the x64 powershell. I tried with System32 and also Syswow64 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -Command ". \DomainName\NetLogon Windows_Path_Enumerate.ps1 -FixUninstall" also with syswow64
I am trying with Invoke-Command -ComputerName pc1 -FilePath "C:\ps1file -FixUninstall" i got error as 'the value of the filepath must be windows powershell. I am noob but like to try this script for remote computer.
NickStudy, you could try this path for sccm pachage: %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
More info here
Through Invoke-Command it could be done like this:
$Session = New-PSSession -ComputerName 'Server1'
Copy-Item -Path "C:\LocalPath\Windows_Path_Enumerate.ps1" -Destination "C:\Temp\" -ToSession $Session
Invoke-Command -Session $Session -ScriptBlock {
. C:\Temp\Windows_Path_Enumerate.ps1 -FixUninstall
}
If you could provide some screenshots from sccm configuration I will be very appreciated, this will help prepare exact instruction
Hi, I used the sysnative. It give 32bit installer error and also 0x1 error running from sccm. Your Invoke command works! I want to run for more than 1 computer. I tried as $Computers = Get-Content C:\list.txt $Session = New-PSSession -ComputerName $Computers and then continue with same lines from you. It did not work. Help me please. Thanks!!!
Copy-Item accept only 1 session in a moment so you need iterate though your list. It will looks like this
$Computers = Get-Content C:\list.txt
$Sessions = New-PSSession -ComputerName $Computers
Foreach ($Session in $Sessions){
Copy-Item -Path "C:\LocalPath\Windows_Path_Enumerate.ps1" -Destination "C:\Temp\" -ToSession $Session
}
Invoke-Command -Session $Sessions -ScriptBlock {
. C:\Temp\Windows_Path_Enumerate.ps1 -FixUninstall
}
I will do, thanks!
There is a key call 'Uninstall Path', it needs the quotes too but not in the script. How do I add that?
There is a key call 'Uninstall Path', it needs the quotes too but not in the script. How do I add that?
what do you mean? if some path should be fixed but its not, please provide exact path and value
@NickStudy how is going?
Is your feature request related to a problem? Please describe. Use case scenarios should be described in documentation (wiki) How to use topics:
Additional context Links on wiki docs should be added to the main readme.md page