Category: Windows 2012

SQL Powershell tools

I’m not sure why MS makes it so convoluted to install these tools on a server that isn’t running SQL.  Regardless, head here:

https://www.microsoft.com/en-us/download/details.aspx?id=29065

And don’t click download.  All that gets you is a text file.  Instead, head down the page and expand Install Instructions.  From there, search for and download the following modules:

  • Microsoft® System CLR Types for Microsoft® SQL Server® 2012 (SQLSysClrTypes.msi)
  • Microsoft® SQL Server® 2012 Shared Management Objects (SharedManagementObjects.msi)
  • Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server® 2012 (PowerShellTools.msi)

If you get a 2503 or 2502 error while trying to install, as I did, you may not have sufficient rights.  Try either killing explorer.exe and restarting it with admin privs or invoking the msi from within an elevated command prompt.

Then just install modules a la:

Import-Module sqlps -DisableNameChecking

Windows: Updating existing ODBC Data Source Drivers

For some reason there still isn’t any easy way to update the driver used on a previously defined ODBC data source in Windows. There’s no option when stepping through the configuration. I suppose you’re expected to delete and recreate the data sources, specifying the new driver at that time. But what if you have dozens, or hundreds, of existing sources?

Do it though the registry.
Continue reading

OpenVPN reconnect

My OpenVPN likes to have difficulty and go yellow from time to time.  The problem with this is twofold – I have any and all downloads stop at the absence of VPN, and when I’m not home connecting to my server is more difficult when VPN has hundged up.  The simplest fix for now is just to restart/reconnect VPN on the daily.

I use OpenVPN with PIA.
Continue reading

Windows – Force Applications to Use VPN

Got an app you want to work only when connected to VPN?  Have Windows Firewall do the work for you

First, connect to your VPN.  Then, ensure that your Public connection is that VPN connection.  You can do this by opening Network and Sharing Center.  In the example below, clicking on Ethernet 3 on the Unidentified network reveals the VPN IP address.

apng Continue reading

Windows – Migrating Printers

At my POE we use virtual printers for all manner of file production.  It’s annoying.  What’s more annoying is when it’s time to upgrade a server using virtual printers.  Thankfully there’s a way to sorta kinda help the process, by sorta kinda easing the migration process.  The following screenshots are from Windows 2012 R2.  If you’re using a different Windows OS level your mileage may vary.  It’s my understanding that the titles of some of this differs by OS.

Continue reading

Windows Sticky Notes

I admit it – I use Windows Sticky Notes.  I hate how unconfigurable it feels though.  The font is terrible, for instance.  Lucky you can change it with a reghack.

What’s happening here is, because the notes demand to use Segoe Print as the font, you’re changing what font Segoe Print actually is.  Replace the .ttfs with fonts of your choice.

There are also a myriad of shortcuts for modifying existing note text:

Ctrl+B – Bold text
Ctrl+I – Italic text
Ctrl+T – Strikethrough
Ctrl+U – Underlined text
Ctrl+Shift+L – Bulleted (press once) or Numbered (press twice) list
Ctrl+Shift+> – Increased text size
Ctrl+Shift+< – Decreased text size
Ctrl+A – Select all
Ctrl+Shift+A – Toggles all caps
Ctrl+L – Left aligns text
Ctrl+R – Right aligns text
Ctrl+E – Centers text
Ctrl+Shift+L – Small Alpha list (3rd), Capital Alpha list (4th), small roman (5th), Capital roman (6th)
Ctrl+1 – Single-space lines
Ctrl+2 – Double-space lines
Ctrl+5 – Set 1.5-line spacing
Ctrl+= – Subscript
Ctrl+Shift++ – Superscript

App Pools Gone Mad!

IIS.  I’m not a fan.  But it’s a requirement where I work, so there you go.  Occasionally one of our IIS servers will slow to a crawl or stop responding altogether.  Often it’s a application pool run amok.  An app pool is essentially a container that holds the processes of a web application.  And if your web application isn’t written well, and doesn’t have decent controls in it, it can go nuts.  If someone can, say run an open ended database query with the potential to return a bajillion records because your app doesn’t disallow this sort of irresponsible behavior, the app pool containing that process is going to fill. And fill. And fill, eventually gobbling all  your processor cycles. An easy way to discern this is if the process w3wp.exe is pegging your CPU at 99%.  Find this in Task Manager.

Continue reading

Active Directory Account Lockout – Creation – Deletion – Disable monitoring

We’ve used a variety of third party tools to monitor Active Directory domain account changes.  They’ve all either been expensive or kind of sucked (or, unfortunately, both).  But if you’re running a relatively new OS on your controller you can use the magick of Powershell to ship you alerts on account changes!  Powershell can monitor the local Security Event Log on your controller and ship you an email when events matching your description are entered.  Here’s an example Powershell script:

Continue reading

List of Roles and Features – Windows 2012

Need a quick list of currently installed roles and features on your Windows 2012 server?  Open a PowerShell prompt and put in the following:

1
Get-WindowsFeature -ComputerName COMPUTERNAME | Where-Object InstallState -eq Installed > installed.txt

It’ll give you a list similar to this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] File and Storage Services                           FileAndStorage-Services        Installed
    [X] Storage Services                                Storage-Services               Installed
[X] Web Server (IIS)                                    Web-Server                     Installed
    [X] Web Server                                      Web-WebServer                  Installed
        [X] Common HTTP Features                        Web-Common-Http                Installed
            [X] Default Document                        Web-Default-Doc                Installed
            [X] Directory Browsing                      Web-Dir-Browsing               Installed
            [X] HTTP Errors                             Web-Http-Errors                Installed
            [X] Static Content                          Web-Static-Content             Installed
        [X] Health and Diagnostics                      Web-Health                     Installed
            [X] HTTP Logging                            Web-Http-Logging               Installed
        [X] Performance                                 Web-Performance                Installed
            [X] Static Content Compression              Web-Stat-Compression           Installed
        [X] Security                                    Web-Security                   Installed
            [X] Request Filtering                       Web-Filtering                  Installed
        [X] Application Development                     Web-App-Dev                    Installed
            [X] .NET Extensibility 4.5                  Web-Net-Ext45                  Installed
            [X] ASP.NET 4.5                             Web-Asp-Net45                  Installed
            [X] ISAPI Extensions                        Web-ISAPI-Ext                  Installed
            [X] ISAPI Filters                           Web-ISAPI-Filter               Installed
    [X] Management Tools                                Web-Mgmt-Tools                 Installed
        [X] IIS Management Console                      Web-Mgmt-Console               Installed
[X] .NET Framework 3.5 Features                         NET-Framework-Features         Installed
    [X] .NET Framework 3.5 (includes .NET 2.0 and 3.0)  NET-Framework-Core             Installed
[X] .NET Framework 4.5 Features                         NET-Framework-45-Fea...        Installed
    [X] .NET Framework 4.5                              NET-Framework-45-Core          Installed
    [X] ASP.NET 4.5                                     NET-Framework-45-ASPNET        Installed
    [X] WCF Services                                    NET-WCF-Services45             Installed
        [X] HTTP Activation                             NET-WCF-HTTP-Activat...        Installed
        [X] Message Queuing (MSMQ) Activation           NET-WCF-MSMQ-Activat...        Installed
        [X] Named Pipe Activation                       NET-WCF-Pipe-Activat...        Installed
        [X] TCP Activation                              NET-WCF-TCP-Activati...        Installed
        [X] TCP Port Sharing                            NET-WCF-TCP-PortShar...        Installed
[X] Enhanced Storage                                    EnhancedStorage                Installed
[X] Message Queuing                                     MSMQ                           Installed
    [X] Message Queuing Services                        MSMQ-Services                  Installed
        [X] Message Queuing Server                      MSMQ-Server                    Installed
[X] SMB 1.0/CIFS File Sharing Support                   FS-SMB1                        Installed
[X] User Interfaces and Infrastructure                  User-Interfaces-Infra          Installed
    [X] Graphical Management Tools and Infrastructure   Server-Gui-Mgmt-Infra          Installed
    [X] Server Graphical Shell                          Server-Gui-Shell               Installed
[X] Windows PowerShell                                  PowerShellRoot                 Installed
    [X] Windows PowerShell 4.0                          PowerShell                     Installed
    [X] Windows PowerShell 2.0 Engine                   PowerShell-V2                  Installed
    [X] Windows PowerShell ISE                          PowerShell-ISE                 Installed
[X] Windows Process Activation Service                  WAS                            Installed
    [X] Process Model                                   WAS-Process-Model              Installed
    [X] Configuration APIs                              WAS-Config-APIs                Installed
[X] WoW64 Support                                       WoW64-Support                  Installed

To view in the prompt rather than dumping to a txt, remove the

1
> installed.txt