Run Powershell without UAC limit

Lorenz
Beiträge: 6
Registriert: 31 Mär 2020, 14:31

Run Powershell without UAC limit

Beitragvon Lorenz » 27 Okt 2020, 08:13

Hello,

here I have one question.
I want to run the powershell script but this need pass the UAC.

the xx.ps1 file will be put in this location:
/var/lib/opsi/depot/win10-x64/custom/postinst.d

I have test some solution like:
1: x.CMD
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
2: x.reg
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLUA"=dword:00000000

but all those need run as administrator or reboot.

anybody could support me, the purpose of this powershell script is to remove some windows build-in applications.

Get-AppxPackage -allusers *communicationsapps* | Remove-AppxPackage
Get-AppxPackage -allusers *alarms* | Remove-AppxPackage
Get-AppxPackage -allusers *phone* | Remove-AppxPackage
Get-AppxPackage -allusers *messaging* | Remove-AppxPackage
Get-AppxPackage -allusers *soundrecorder* | Remove-AppxPackage
Get-AppxPackage -allusers *getstarted* | Remove-AppxPackage
Get-AppxPackage -allusers *gethelp* | Remove-AppxPackage
Get-AppxPackage -allusers *feedback* | Remove-AppxPackage
Get-AppxPackage -allusers *solitaire* | Remove-AppxPackage
Get-AppxPackage -allusers *3dbuilder* | Remove-AppxPackage
Get-AppxPackage -allusers *bing* | Remove-AppxPackage
Get-AppxPackage -allusers *zune* | Remove-AppxPackage
Get-AppxPackage -allusers *xboxapp* | Remove-AppxPackage
Get-AppxPackage -allusers *officehub* | Remove-AppxPackage
Get-AppxPackage -allusers *onenote* | Remove-AppxPackage
Get-AppxPackage -allusers *skypeapp* | Remove-AppxPackage
Get-AppxPackage -allusers *remotedesktop* | Remove-AppxPackage
Get-AppxPackage -allusers *oneconnect* | Remove-AppxPackage
Get-AppxPackage -allusers *wallet* | Remove-AppxPackage
Get-AppxPackage -allusers *windowsstore* | Remove-AppxPackage
Get-AppxPackage -allusers *MixedReality.Portal* | Remove-AppxPackage
Get-AppxPackage -allusers *people* | Remove-AppxPackage
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*communicationsapps*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*alarms*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*phone*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*messaging*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*soundrecorder*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*getstarted*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*gethelp*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*feedback*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*solitaire*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*3dbuilder*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*bing*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*zune*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*xbox*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*officehub*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*onenote*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*skype*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*oneconnect*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*wallet*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*windowsstore*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*MixedReality.Portal*"} | Remove-AppxProvisionedPackage –Online
Get-AppxProvisionedPackage –Online | where-object {$_.packagename –like "*people*"} | Remove-AppxProvisionedPackage –Online



thanks

BR
Lorenz

Benutzeravatar
SisterOfMercy
Beiträge: 1196
Registriert: 22 Jun 2012, 19:18

Re: Run Powershell without UAC limit

Beitragvon SisterOfMercy » 27 Okt 2020, 10:14

I do a similar thing, but get no UAC prompt.
I have this as one of the first things that runs on a reinstall. I don't think there's anything that disables UAC.

I've included all stuff I remove, because I've just updated this list, so it might help you.

Code: Alles auswählen

   comment "Remove provisioned Appx packages"
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.BingWeather*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.DesktopAppInstaller*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.GetHelp*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Getstarted*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.HEIFImageExtension*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Messaging*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Microsoft3DViewer*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.MicrosoftOfficeHub*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.MicrosoftSolitaireCollection*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.MicrosoftStickyNotes*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.MixedReality.Portal*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.MSPaint*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Office.OneNote*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.OneConnect*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.People*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Print3D*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.ScreenSketch*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.SkypeApp*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.StorePurchaseApp*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.VP9VideoExtensions*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Wallet*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WebMediaExtensions*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WebpImageExtension*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Windows.Photos*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WindowsAlarms*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WindowsCalculator*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WindowsCamera*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*microsoft.windowscommunicationsapps*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WindowsFeedbackHub*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WindowsMaps*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.WindowsSoundRecorder*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.Xbox.TCUI*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.XboxApp*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.XboxGameOverlay*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.XboxGamingOverlay*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.XboxIdentityProvider*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.XboxSpeechToTextOverlay*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.YourPhone*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.ZuneMusic*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.ZuneVideo*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   powershellCall('Get-ProvisionedAppxPackage -online | Where-Object {$_.DisplayName -like "*Microsoft.549981C3F5F10*"} | Remove-AppxProvisionedPackage -Online -AllUsers')
   
   ; https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10
   comment "Remove Appx packages"
   powershellCall('Get-AppxPackage *Microsoft.WindowsCamera* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Framework.1.7* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Framework.1.7* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Runtime.1.7* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Runtime.1.7* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Windows.Photos* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *microsoft.windowscommunicationsapps* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Advertising.Xaml* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Advertising.Xaml* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.XboxIdentityProvider* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WindowsAlarms* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.StorePurchaseApp* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.VP9VideoExtensions* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.ScreenSketch* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.YourPhone* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.XboxSpeechToTextOverlay* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.XboxGamingOverlay* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.XboxGameOverlay* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Xbox.TCUI* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WindowsSoundRecorder* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WindowsMaps* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WindowsCalculator* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WebpImageExtension* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.WebMediaExtensions* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Wallet* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Print3D* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Services.Store.Engagement* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Services.Store.Engagement* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.People* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.OneConnect* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.MSPaint* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.MixedReality.Portal* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.MicrosoftStickyNotes* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.MicrosoftOfficeHub* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Microsoft3DViewer* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.HEIFImageExtension* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.GetHelp* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.DesktopAppInstaller* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.BingWeather* | Remove-AppxPackage -AllUsers')
   powershellCall('Get-AppxPackage *Microsoft.549981C3F5F10* | Remove-AppxPackage -AllUsers')

   comment "Remove Appx packages for Administrator"
   powershellCall('Get-AppxPackage *Microsoft.WindowsCamera* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Framework.1.7* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Framework.1.7* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Runtime.1.7* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.NET.Native.Runtime.1.7* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Windows.Photos* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *microsoft.windowscommunicationsapps* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Advertising.Xaml* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Advertising.Xaml* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.XboxIdentityProvider* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WindowsAlarms* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.StorePurchaseApp* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.VP9VideoExtensions* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.ScreenSketch* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.YourPhone* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.XboxSpeechToTextOverlay* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.XboxGamingOverlay* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.XboxGameOverlay* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Xbox.TCUI* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WindowsSoundRecorder* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WindowsMaps* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WindowsCalculator* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WebpImageExtension* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.WebMediaExtensions* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Wallet* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Print3D* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Services.Store.Engagement* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Services.Store.Engagement* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.People* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.OneConnect* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.MSPaint* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.MixedReality.Portal* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.MicrosoftStickyNotes* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.MicrosoftOfficeHub* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Microsoft3DViewer* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.HEIFImageExtension* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.GetHelp* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.DesktopAppInstaller* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.BingWeather* | Remove-AppxPackage -User Administrator')
   powershellCall('Get-AppxPackage *Microsoft.549981C3F5F10* | Remove-AppxPackage -User Administrator')
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Lorenz
Beiträge: 6
Registriert: 31 Mär 2020, 14:31

Re: Run Powershell without UAC limit

Beitragvon Lorenz » 28 Okt 2020, 01:07

hi, thanks for your support.
where you put this code as opsiscript file?

Benutzeravatar
SisterOfMercy
Beiträge: 1196
Registriert: 22 Jun 2012, 19:18

Re: Run Powershell without UAC limit

Beitragvon SisterOfMercy » 28 Okt 2020, 03:15

Lorenz hat geschrieben:hi, thanks for your support.
where you put this code as opsiscript file?


In a seperate package. You said something about "/var/lib/opsi/depot/win10-x64/custom/postinst.d", which gives me the hunch you have not yet created any opsi packages? It's far easier to dump all customisations in a package.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Lorenz
Beiträge: 6
Registriert: 31 Mär 2020, 14:31

Re: Run Powershell without UAC limit

Beitragvon Lorenz » 28 Okt 2020, 05:23

yes, no package until now.
:cry: I am not sure how to create own package right now.

Benutzeravatar
SisterOfMercy
Beiträge: 1196
Registriert: 22 Jun 2012, 19:18

Re: Run Powershell without UAC limit

Beitragvon SisterOfMercy » 28 Okt 2020, 20:53

Well, the documentation is your friend: https://download.uib.de/opsi4.1/documentation/html/en/
Especially chapter 10 in the getting started.

The opsi-template package might help you with a basis for your own scripts. Also look in the wiki for examples. Start with a simple script first.

If you're doing this professionally you might want to get an opsi basics workshop.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!