Posts

Showing posts with the label Powershell

Powershell script - Rename computer and join domain

I had to automate the process. I used the following script: $hostname = read-host 'hostname' $Domain = 'domain.com' $Credential = Get-Credential Rename-Computer $hostname Add-Computer -Domain $Domain -NewName $hostname -Credential $Credential -Restart -Force if you also need to setup ip: $ipaddress = read-host 'enter new ip' $gateway = read-host 'gateway:' $prefix = read-host 'prefix (ie 24):' $dns1 = read-host 'dns 1' $dns2 = read-host 'dns 2' New-NetIPAddress –IPAddress $ipaddress -DefaultGateway $gateway -PrefixLength $prefix -InterfaceIndex (Get-NetAdapter).InterfaceIndex Set-DnsClientServerAddress -InterfaceIndex (Get-NetAdapter).InterfaceIndex -ServerAddresses ($dns1, $dns2) $hostname = read-host 'hostname' $Domain = read-host 'domain' $Credential = Get-Credential Rename-Computer $hostname Add-Computer -Domain $Domain -NewName $hostname -Credential $Credential -Restart -Force

[SOLVED] Extend Microsoft SQL Server Trial / Evaluation period

Image
Restart SQL service after trial period - and continue using it The problem usually occurs when you are running an evaluation instance of SQL Server and the evaluation time period has expired. I will show you a workaround, that enables you to continue using SQL even though it has expired.

How to remove windows 8.1 metro apps

Here i will show you, how to remove the pre-installed windows apps with powershell.

Powershell - Create 100 AD users

Hi, I had the need for 100 users for a test environment i was building. So heres the powershell script that i used to create them.

Changing keyboard layout / language in powershell

To change keyboard layout in powershell use the following command:

Powershell - CSV Column Manipulation

If you want to change a csv file, there might be easier ways than open it in excel and edit / remove the columns that you dont need. In this example. I had to extract all the Latitude and Longitude from earthquackes the past month. This was a somewhat 10 000 line long file. So why not try it in Powershell. Headers looked like this   time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net,id,updated,place,type

Popular posts from this blog

[SOLVED] Veeam: Failed change tracking (CBT)

Fixing Error 25541. Failed to open XML file