Skip to main content

Posts

Showing posts with the label Windows Server

Windows Server 2008: Log on as batch job

From time to time, I have to set up some scheduled tasks that required a dedicated account to run. And when doing so, I'll usually forget that the dedicated account usually isn't given any more permissions than what it needs to complete the task at hand. So, after setting up the task, Windows will usually yell at me and say "The account needs batch job rights". So here's how to grant batch job permissions on your server. Go to your start menu, and start searching for Local Security Policy In the left pane of the MMC that opens up, expand Local Policies, and highlight User Rights Assignment. Now, in the left right pane, locate "Log on as a batch job" and double click it. In the properties window that opens up, add the user or group that needs this permission. I find that if you have multiple service accounts running different tasks on the same server, it's easier to just add a group verses the individual a...

Registering ASP.NET for IIS Applications

I've recently learned that it's not a bad idea to register ASP.NET with new instances of IIS. This tends to aid in resolving various issues with ASP.NET web extensions. Here's the quick and easy way to get that done. Open command prompt as Administrator and issue the following: cd c:\Windows\Microsoft.NET\Framework64\v4.0 The last directory 'v4.0' may be different depending on what version is installed. You will want to select the latest version that is available on your system. Now, in that directory, issue the following: aspnet_regiss -i You should see the following output: From there you need to reset IIS by issuing the following: iisreset Once that completes you should be good to go.

PowerShell Scripting: Low Disk Space Notification

Update 20150812 You'll see in the below comments that I left a global variable that was not required in the original script. The below post has been updated with that variable removed. Original Post So, I came across a need to have a script that checks the free space of a hard drive, calculates the percentage and send an e-mail notification of the free space is less than 10%. I figured that this could be scripted with PowerShell and run as a scheduled task in Windows. One thing I did find out is that I needed to create a service account in Active Directory with Server Admin permissions. Once you have that account in place simply copy the script below and name it "WhatYouWant.ps1" and set your Windows task accordingly. Disclaimer: I did reach out for assistance with creating this script on StackOverflow. My original script was writing the output to a text file, and copying the contents of that text file into the e-mail notification. This was not acceptable for the long...

PowerShell Scripting: Get File Share Paths

Recently I was requested to locate the configured shares on the file servers and how they are mapped to their associated directories. As this information not only had to be retrieved, but also typed out to be passed along to the various managers, I decide a nice little PowerShell command would help accomplish this task in a quick fashion. What this command is set up to do is to get the file shares and organize them by the name and path, get the logical mapping of that share and finally pipe that information into a file called "outfile.txt" in the C:\temp directory. The location that the command saves to as well as the file name can be changed to whatever knocks your socks off. To get the share file paths in use by a server issue command: Get-WmiObject win32_share | ft name, path - auto | win32_logicaldisk | Out-File C:\temp\outfile.txt This command will result in the outfile.txt and you can then copy and paste that information into whatever documentation you would like...

PowerShell Scripting: Removing Multiple Directories

Update 20150916 So the pic I used to display the CSV sample went missing. So the latest update just includes a text version of what was displayed. Thanks! Original Post I'm still fairly new to utilizing PowerShell to automate tasks and get big tasks done. But every time I use it, the tool makes my life a whole lot easier. Recently I was tasked with deleting over 500 directories. Thankfully someone else had the task of identifying the directories that were slated to be deleted, I just had to complete the process of removing them. Thanks to a little article from the Scripting Guy! Blog (found HERE ) I had some direction to start in. What I ended up doing is creating a single column CSV file that contains the path to the directories to be deleted. This path includes drive letter, and the overall path to the folder. It should look similar to this: delete C:\Path\to\folder C:\Path\to\folder2 D:\Path\to\folder D:\Path\to\folder2 I named the file "delete.csv" and pla...

NTP Server Setup

So some time back I was asked to set up an NTP (Network Time Protocol) server for a client. The particular environment only has a few servers that can access the internet, which were used primarily for WSUS, and the rest of the environment has internet access blocked. So, in this process I'll walk you through installing Meinberg NTP Software (check them out here) and then configuring the PDC's (Primary Domain Controller) registry to obtain time from the newly installed service. I know, I could just set a GPO to order all of the servers in the network to get time from the NTP server, but my goal in this was to limit traffic to the internet connected servers. What I found out is that by default all Windows systems get their time from the PDC by default and update at the time of login. By changing the PDC's registry this default configuration stays in place, and I don't have to wait for the GPO to update throughout the network... Setup and Instillation Create NTP se...

Remote Desktop CTL-ALT-DEL

I get this question quite often from some of the remote users that utilize their VMs via RDP. Especially since the environment in which they work in requires a password change every 90 days....I've told them multiple times how to do this, but as it is not widely documented, I suppose I could make a note here just to aid those that stumble upon this through Googling the question: "How to CTL-ALT-DEL in an RDP session?" Well simply put the answer is: CTL-ALT-END I know, it doesn't make much sense, but it works. That's all you need to know.

JBoss 4.2.2 in Windows Server 2008

A little background on this project, and why I needed to run a vulnerable JBoss instance in my environment. I have a client that wanted to demo a web app that utilizes JBoss as it's prmary middleware. The web app is completly built around JBoss 4.2.2 so unfortunately I had no other option but to use it. Eventually, if the client decides to purchase the web app I will be putting extra security on the server so that the sensitive/hackable areas of JBoss are at least password protected, and I will post directions on that accordingly. As of now the only access to the server is through a VPN into the environment. The big security issues will occur when the client wants to access the web app via the internet without the VPN... After successfully installing JBoss (easiest part of this whole thing), the client wanted it to be turned into a Windows service, then wanted it to bind on the host IP address or host name. This is so that they can access the web app without being connect to the ...