Archive for the ‘Uncategorized’ Category

Geo Location Database

Saturday, April 15th, 2017

Need a free geolocation database ? Why not give the guys over at MaxMind a go ?

GeoLite2 Free Downloadable Databases

Powershell launch options

Tuesday, December 29th, 2015

There are a few things that we can do when launching powershell.

1) We can simply start qowrdshell by typing “powershell” at the command prompt.
2) We can launch powershell faster by not displaying the banner – we do this using the command “powershell -nologo”
3) We can launch an older version of powershell by stating which version to launch e.g. “powershell -version 3”
4) We cab launch powershell using a specific configuration fie (e.g. “powershell -psconsolefile my console.psc1”
5) we can launch powrrshell an tell it to run a command on launch – powershell -command “& {get-service}”

System Center Service Accounts

Thursday, December 26th, 2013

There’s a very good list of all of the service accounts required for System Center 2012 at http://systemscentre.blogspot.co.uk/2012/05/system-cennter-2012-service-accounts.html.

Want to know which Active Directory Groups you are a member of ?

Thursday, December 12th, 2013

If you want to know which Active Directory Groups you are a member of and you do not have access to AD, simply open up a command prompt and type

whoami /groups

Nice little trick if you are doing deskside support and want to quickly check that the user is in the right groups

Use PowerShell to sync all Active Directory sites

Thursday, November 28th, 2013

Here’s a quick script for you to synchronise your entire domain

Import-Module ActiveDirectory

$DCs = Get-ADDomainController -Filter *

Foreach ($DC in $DCs) {

$replicate = ‘repadmin /syncall /A /d /e ‘+$DC

iex $replicate

}

Just save it as a ps1 file and run it on any machine with the AD remote server admin tools installed or even a domain controller. If you are delegating rights, delegate them at the root of the domain in Active Dircetory Users and Computers and for each context that you want to replicate in ADSI Edit (see http://www.msresource.net/knowledge_base/articles/how_to:_delegate_the_ability_to_manually_replicate_dcs_using_a_tool_such_as_dssite.msc_or_replmon.html).

if you only want to replicate part of the topology, use the code below:

 

Import-Module ActiveDirectory
$DCs =Get-ADDomainController -Filter *
$Char = [Char]34
$Scope = $Char + ‘DC=Domain,DC=com’ + $Char

Foreach ($DC in $DCs) {
$DC.hostname
$replicate = ‘repadmin /syncall /e ‘ + $DC + ‘ ‘ + $Scope
iex $replicate

}

Want to fully remove a feature ?

Thursday, November 28th, 2013

New to Windows 2012 is the ability to reduce your attack surface further by physically removing binaries from the operating system. Its really quite simple to do. Using the uninstall-windowsfeature command we append the -remove switch and that removes the install binaries from the hard drive.

If you need to add them back then, when using the install-windowsfeature command you will need to add the -source switch and make the installation source available (from a DVD or extracted ISO).

The easiest way to achieve this is to extract the \sources\SxS folder from the install DVD to a file share. The file share will need to be able to be accessed by computer accounts with Read rights. In this way, the features are available for install to any server if they have been removed.

Did I license my server with a MAK key or a KMS key ?

Thursday, November 28th, 2013

Enter the following command to find out:

slmgr /dli

Quick way to restart your server

Thursday, November 28th, 2013

Finding it a pain to navigate to the Charms | Power | Reboot command ? Want a simpler way of restarting your server  ?

start a powershell session and enter Restart-Computer.

You don’t even need Windows 2012 as it works with 2008 R2 also.

Of course, if you are really lazy you can just type the word “restart” – that works just as well 🙂

Restoring the GUI in Windows Server 2012

Thursday, November 28th, 2013

If you want to restore the GUI in Windows Server 2012 (and you didn’t install in core mode) you can use the following command

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -restore

If you did install core, you need to have the CD / ISO inserted or mounted and append the -Source switch to tell it where to get the files to perform the install of the GUI from. i.e. you enter:

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -Source C:\Source -restart

List a computers IP addresses easily

Thursday, November 28th, 2013

Now, we all know how to get a computers IP address, right . You enter ipconfig and press return. So far so good. But what if a computer has multiple NICs as they something’s do. Then it can be a bit of a chore sorting the wheat from the chaff. So, here’s a tip for just showing the IPV4 addresses. Enter the following instead.

Ipconfig | find “IPv4”