Running batch and powershell scripts as administrator

WINDOWS – RUN BATCH AND PS AS ADMINISTRATORS. This works for Windows 7 and newer. I tested on Windows 7 and 10 64bit and 32bit. This is a faster vbs version of the below script: net sess>NUL 2>&1||(echo.CreateObject^(“Shell.Application”^).ShellExecute”%~0″,,,”RunAs”,1 >”%TEMP%\%~nx0.vbs”&WScript “%TEMP%\%~nx0.vbs”&del “%TEMP%\%~nx0.vbs”&exit) #RUNNING CMD/BAT files as administrator, place this at the top of script after @echo ...

Running a powershell command via batch or command that is restricted

I had to run a powershell module that I found remotely to remove some pinned applications in Windows 7. I also wanted it to run remotely, and not have to log on to each PC to do so. To kick off a powershell script, I had to add this to a command file: REM KICK ...

Windows 10 not searching desktop applications with cortona

Out of the blue, my start -> search stopped functioning, it would just be blank. I reinstalled Cortana using the following procedure: Open an elevated Command Prompt window (press win + X, and then press A) Type start powershell and press enter Run the command (in one line): Get-AppXPackage -Name Microsoft.Windows.Cortana | Foreach {Add-AppxPackage -DisableDevelopmentMode ...

Adding User Principal Names in Active Directory via PowerShell for Federation

I wanted to update the UPN or User Principal Names in our AD, as we had a couple thousand users that had been in our AD for over 10 years, in the NT days. So they were created without UPN’s. This will print out the list of users and output it to a file so ...