Tuesday, March 5, 2019

PowerShell Resources

Since its release waaay back in November of 2006, PowerShell usefulness has continued to grow.

With all the different modules, capabilities and properties, it's hard to keep up with the language. Luckily there are numerous resources available to us.

Since I often use my own blog as a resource, here's a list of sites to keep me and you successful and informed.

Microsoft PowerShell - From the "mothership"

Idera Community - Nice group, lots of info

PowerShell Scripts Blog - A few hundred scripts to choose from

Get-PowerShell - A little crusty, but over one hundred examples

A Taste of PowerShell - Quite crusty, but lots of useful examples

Also don't forget Spiceworks and Experts Exchange for tutorials and problem solving.

Sunday, February 10, 2019

Resetting a Lost Windows Password

So, you need to get into an old Windows system with a forgotten password, or perhaps you're helping out a hapless friend.

Luckily all you need is a bootable Windows disk, preferably Windows 7 or newer.

Note: If this is an encrypted system, you are likely hosed.

There's only a handful of steps to get you logged back in...

1. Once booted into the Install screen, choose Repair my computer

2. Choose Open a Command Window

3. Find the drive that contains Windows, usually C: or D:

4. cd to Windows\System32, then you need two commands

5. copy Utilman.exe \  (this is to preserve the file if you to restore it later)

6. copy Cmd.exe Utilman.exe  (Overwrite confirm: Yes)

7. Exit and Reboot

8. On login screen, click the accessibility app (now Cmd.exe)

9. Reset the administrator password:  net user administrator YourCoolP@ssword

10. Enable the administrator account:  net user administrator /active: yes

11. Now go to the login prompt (may need to choose Other User), and enter .\administrator (to use the local administrator account) and your newly reset password.

12. High-fives all around!

Saturday, January 26, 2019

Windows Broken Program Installs

We've all been there, not able to install, update, or remove a program because there is something else installed that is damaged or didn't properly clean up after itself.

That happened to me again recently with a Visual C++ Runtime, but this time I found this little updated gem from Microsoft.

It removes corrupted Registry entries, errant file entries in Programs and Features, plus I'm sure more they don't even mention.

Friday, January 18, 2019

Using Diskpart for a Bootable USB

Q: How many systems come with CD or DVD drives these days?

A: Close to nil.

If you need to create a bootable USB drive, Diskpart can get the job done for you. You can then dump whatever it is you need to run onto the remainder of the free space.

  1. Open a Cmd window as Administrator
  2. Run diskpart
  3. Type list disk, this will show which one is your USB drive
  4. Type select disk # where # is the USB drive from Step 3
  5. Type clean, hit enter
  6. Type create part pri + enter, then select part 1 + enter
  7. Type format fs=ntfs quick + enter (for UEFI systems, use format fs=fat32 quick)
  8. Type active + enter, then exit.
  9. Optional: Copy your files onto the USB drive, i.e. the contents of an ISO

Monday, February 9, 2015

Someone is currently logged into the APC

Time was APC was the Cadillac of the power management world. But in my opinion, as with many vendors they're not keeping up with the times. Case in point our APC AP7990 PDUs. We're no longer able to use any modern browser to manage them. And when we use an older browser, we've been getting "Someone is currently logged into the APC Management Web Server." when attempting to login, because it's not resetting the session when disconnecting.

Logging into the terminal and back out to reset the web interface fixes this, but if you're doing that securely as you should with SSH, not Telnet, using PuTTY, you get an error message "Received SSH2_MSG_CHANNEL_SUCCESS for nonexistent channel 65536". To get around that try using a Linux or BSD-based system to SSH to the PDU, although that resulted in a "Broken pipe" error at times...

Unfortunately the heart of the matter is their products, like many manufactures' devices are using old, broken security protocols, ciphers and versions of Java, with no hope of ever being updated. And now with all modern browsers and JVM security settings at all-time high, they block access to these remote management web interfaces. Truly a frustrating development since there is no way to push manufacturers to update what should amount to a simple fix (if they have sensible software dev practices). I don't expect companies to support products forever the way Microsoft does, but when their products become completely unmanageable because of far-reaching, widely-known security flaws in Bash, OpenSSH, SSL and Java, they should be on the hook to spend a few cycles on helping the people who buy their products. (Okay, off my soapbox.)

And by all means, click Log Off when using the APC PDU web interface.

Monday, November 10, 2014

Ifconfig: command not found

CentOS, say it isn't so! Having just done the minimal install of CentOS 7 as a VM, I wanted to install VMware tools. I thought I installed all the prerequisites when the script halted at "Setup is unable to find the "ifconfig" program on your machine."

I ended the script and incredulously ran the ifconfig command, thinking it had to be wrong, but it's no longer included. The ip command has now taken over networking duties, but the VMware script didn't care. I ran yum provides ipconfig, but no love: "No package ifconfig available". A couple of web searches later and I found the package I needed to bring it back...

# yum install net-tools

BTW, don't be surprised if Fedora and RHEL (and it's other offspring) are missing ifconfig as well.

Sunday, November 2, 2014

Developer Cannot Be Confirmed

I bought a new camera recently and decided I needed the "old" version of Photoshop I had lying around on my MacBook so I could salvage pics taken with my n00btastic photo skills. So as any reasonable person would do, I installed and then attempted to update Photoshop with the latest available patch from Adobe.

Finding the correct patch on Adobe's site wasn't exactly intuitive, which is surprising from a company that specializes in making software for the web, anyway I digress. Once the patch was downloaded, it wouldn't install. "AdobePhotoshop12-4-mul-AdobeUpdate.dmg can't be opened because the identity of the developer cannot be confirmed." Seems hard to believe, and I'm not sure who's to blame here, but after some searching it seems there are a number of rather large companies, i.e. Oracle, that have the same issue. (Either devs are signing their apps incorrectly or Apple released a patch/update breaking the previous verification mechanism.)

In any case, if you trust the developer, this can be overruled with a few clicks and your password:

System Preferences > Security & Privacy > General tab and you will see "App in question" was blocked from opening because the identity of the developer cannot be confirmed.

Click the button to allow anyway and enter your password, the app should start installing immediately.