Categories
Windows 10

Create batch file to run with elevated permissions to activate windows 10

I had a task of automating Windows 10 upgrades from Windows 7, and one key thing I needed to do was allow for UAC to exist, AND be able to run batch scripts, or powershell scripts as Administrator. Also known as elevated permissions.

I created a bat file with these contents:

set mydir=%~dp0
Powershell -Command “& { Start-Process \”%mydir%2.bat\” -verb RunAs}”

I then created a second bat file with 2.bat, and placed it in the same directory with this:

cscript C:\Windows\System32\slmgr.vbs -ipk xxxx-xxxx-xxxx-xxxx-xxxx
cscript C:\Windows\System32\slmgr.vbs /ato

This only brings up ONE prompt for the user, the UAC prompt to hit yes. No password required, and not VBS pop ups showing status, thanks to cscript.

Categories
APC

Having issues upgrading APC firmware?

I was upgrading my firmware found on apc’s website, it seemed to fail via the sh file you get from the exe downloaded from apc’s website. It was throwing: APC PDU Error: The application was not able to load.

I could still telnet, and look around. I tried rebooting the management interface, it still showed the error. So what I did was do the FTP upload to reflash, and that resolved it. NO need to do a total reset of everything on it, that most seem to recommend.

*Here is the FTP login/upgrade instructions: (Taken from this [kbase article|http://nam-en.apc.com/cgi-bin/nam_en.cfg/php/enduser/std_adp.php?p_faqid=768])*

For AP9617/18/19 cards that have AOS 1.2.0 firmware and below, you will need to first upgrade to AOS 2.0.2 before upgrading to the latest firmware. AOS 2.0.2 should be included as part of the firmware executable located on the firmware download page.

Items are in bold are the commands.

1. To perform an upgrade with this method the Management Card must have been previously configured with a System IP, Subnet Mask, and Default Gateway and attached to the network. In addition, FTP Server must be enabled.

2. Open an MS-DOS command prompt window on a PC which is connected to the network. Change to the directory which contains the firmware upgrade files.
C:\>cd\apc
C:\apc>

3. Open an FTP client session.
C:\apc> ftp 192.168.1.100 (192.168.1.100 being the IP address of the web card)

4. Log in using the Administrator User Name and Password. Your passwords may be different than the defaults, “apc” and “apc”. Typically, the password will appear on the screen as ***.
Connected to 192.168.1.100
220- APC FTP server ready.
220
User (192.168.1.100 :(none)):*apc*
331 User name okay, need password.
Password:*apc*
230 User logged in, proceed.
ftp>

5. Upgrade the aos first. The aos module is the file with the aos prefix.
ftp> bin
200 Command okay.
ftp>
ftp> put aosXXX.bin (XXX being the version number downloaded)
200 Command okay.
150 Opening data connection for aos301.bin
250 Requested file action okay, completed. Management Card
Rebooting….
327680 bytes sent in 5.99 seconds (54.70 Kbytes/sec)
ftp>

6. Close the FTP client session.
ftp>bye
C:\apc>

7. Wait about 20 – 30 seconds.

8. Repeat Steps 3 – 8 again for the application module (sumx for Smart Ups/Matrix, sy for Symmetra, etc). In Step 6, substitute the sumx module file name, in place of the aos module file name. Or the sy prefix for the Symmetra.

Categories
Windows 10

Windows 10 – issues with installed programs not showing up in search

For whatever reason, windows 10 search stopped searching my all apps. I found out re initializing cortona fixes it, which you can do by running an elevated powershell and pasting this into it:

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}

Once I did that, everything popped up, no reboot was required.

Categories
INTEL NUC

Intel NUC NUC5i5RYH – disable speed step

I am running some homelab stuff with NUC5i5RYH running ESXi. I wanted to know why everything showed up as 1.6ghz and not the 2.7ghz it should burst to. I got a reply from INTEL stating:

The Intel® Core™ i5-5250U Processor is an Ultra-Low power processor (because of the U at the end of the model).

Any U processor cannot disable speedstep which would have allowed me to run full speed, just an FYI to those wanting to do it! You will only get the downclocked speed.

Categories
vmware

Apply ESXi 5.5 Update 2 via cli

With Mike’s excellent post, I was able to update my esxi install from Update 1 to Update 2 via the command line.

Summary:

esxcli network firewall ruleset set -e true -r httpClient
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.5.0-20140902001-standard
esxcli network firewall ruleset set -e false -r httpClient
reboot

To get the list of updates:

esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

Categories
Internet Explorer Windows 10 Windows 7 Windows 8

IE9, and IE10 popups to upgrade to IE11 on Windows

We had users complaining about needing to upgrade to IE11, they were running IE8,9, and 10. I tracked down the KB that was installed on patch tuesday to: KB3124275. We have users who have to use Internet Explorer 10 for specific applications, so we cannot ugprade. I removed it from SUS and users PC’s, hopefully this’ll save someone some time.

You can see the MS KB here: https://support.microsoft.com/en-us/kb/3124275

And note part of the way down it says the GR KB is here:

KB3123303 The new “End of Life” upgrade notification for Internet Explorer

Categories
Logitech Software

Logitech Gaming Software and G930 cutting out every 900 seconds

1- Close the LGS (Right click the icon on task bar and select exit)
2- Go to my computer – Windows – Program Files – Logitech Gaming Software – Resources – G930 – Manifest
3- Right click “Device_Manifest” and select edit
4- Look for battery turnOffInterval=”900″ and change the value to “0”
5- Save the file to desktop
6- Copy the file from desktop to My computer – Windows – Program Files – Logitech Gaming Software – Resources – G930 – Manifest
7- Make sure you replace the file
8- Restart the computer
9- The issue should be solved.

Categories
drivers Printers Server 2008 server 2012

Adding HP Printer gets error 0x0000007e

If a Windows 7 machine cannot add a printer because of a 0x0000007e error: Delete BIDI registry key (on server) from
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\\CopyFiles\BIDI
Sometimes the print spooler needs to be restarted.

Categories
Powershell

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 OFF POWERSHELL STUFF
xcopy "\\domain.com\software\Non-Licensed\scripts\kiosk\Set-PinnedApplications.psm1" C:\temp\
powershell "Set-ExecutionPolicy Unrestricted"
powershell \\domain.com\software\Non-Licensed\scripts\kiosk\Remove_Taskbar_Shortcuts.ps1

The .ps1 file leads to this:

Import-Module C:\temp\Set-PinnedApplications.psm1
Set-PinnedApplication -Action UnPinFromTaskBar -FilePath "C:\Users\kiosk\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Internet Explorer.lnk"
Set-PinnedApplication -Action UnPinFromTaskBar -FilePath "C:\Users\kiosk\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Windows Explorer.lnk"
Set-PinnedApplication -Action UnPinFromTaskBar -FilePath "C:\Users\kiosk\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Windows Media Player.lnk"

So it allows me to remove the pinned applications. If you want to view the module (Set-PinnedApplications.psm1) I used off technet it is here:
https://gallery.technet.microsoft.com/scriptcenter/b66434f1-4b3f-4a94-8dc3-e406eb30b750
You would just copy that content into: Set-PinnedApplications.psm1

Categories
Windows 7

Hide Windows 7 desktop icons through registry and a command or bat file

If you want to hide certain desktop icons via a bat file, you can use this. Just read the REM line to see which 4 registry adds will change a specific icon. I needed this to roll out to a couple hundred computers, versus logging on to them and disabling them individually.

REM hide Computer icon on the desktop
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 1 /f
REM hide Control Panel icon on the desktop
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" /t REG_DWORD /d 1 /f
REM hide User's Files icon on the desktop
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t REG_DWORD /d 1 /f
REM hide Network icon on the desktop
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /t REG_DWORD /d 1 /f
REM hide recycle bin from desktop
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 1 /f
REM hide libraries icon from the desktop
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{031E4825-7B94-4DC3-B131-E946B44C8DD5}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{031E4825-7B94-4DC3-B131-E946B44C8DD5}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{031E4825-7B94-4DC3-B131-E946B44C8DD5}" /t REG_DWORD /d 1 /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{031E4825-7B94-4DC3-B131-E946B44C8DD5}" /t REG_DWORD /d 1 /f