Good Contents Are Everywhere, But Here, We Deliver The Best of The Best.Please Hold on!
Data is Loading...
Your address will show here +12 34 56 78
Network, PowerShell, Server, Windows
In this case we’re going to use the method GetHostAddresses of the Dns class of the Sytem.Net namespace.
For PowerShell 2.0 you can use following Windows PowerShell One Liners:

Name to IP Address (DNS Forward)

IP Address to Name (DNS Reverse)

As of PowerShell 3.0 you can use the method GetHostEntry() for both Forward and Reverse: As of PowerShell 4.0 you can use the Cmdlet Resolve-DnsName as well as for both Forward and Reverse:
0

PowerShell, Server, Windows
Have you ever wondered if there’s an opportunity to easily create a GUI out of every PowerShell Cmdlet?
In many cases this can be very useful for example if your Cmdlet hs too many parameters to list or just to see what’s it offering on Common parameters as well.

Just use the Show-Command cmdlet with any PowerShell cmdlet to bring up a GUI interface.
Let’s try this with the Get-Service Cmdlet and see what’s happening!



You will have three options for executing your command: Run, Copy (for the clipboard), or Cancel.

0

PowerShell, Server, Windows
Okay at the end it’s a simple $PSVersion wrapped in an Invoke-Command but hey these simple things are needful in case you need to run it against of 100s of servers and not just locally. With the help of Invoke-Command via WinRM and $PSVersionTable.psversion wrapped in a foreach you can retrieve PowerShell version of your remote computers indifferent if you need to use credentials to run it against a different domain than you currently reside. Just use the below function Get-PSVersions, simple but good.


While processing your list of computers a nice Write-Progress will give you some details about the status:


Once finished your output will look like this:

0

PowerShell, Server, Windows
If you want to avoid or block coming up your screensaver take this nice script.
It will move your mouse cursor and presses space every minute to simulate user activity.
This all happens with the help of “Wscript.Shell” for sending a key press and “System.Windows.Forms.Cursor” for moving the cursor for 1 pixel.


If you don’t commit a string for the Minutes parameter it will ask you how many minutes you want to simulate activity:


After that the activity is running for the given amount of time:




0

PowerShell, Server, Windows
Get DELL Tag and Express Service Code remotely for more than one computer. You can also commit different credentials for a specific domain.
The below function Get-DellTags retrieves serials remotely from your machines. With the help of the function ConvertSerial the serial gets converted into a DELL Express Service Code on the fly.

 

 

0

Network, PowerShell, Server, Windows
Respective Microsoft’s Technet article regarding Resolve-DnsName I have created you a function with the ability to run it against more than only one computer. Resolve-DnsNames performs a DNS name query resolution for the specified name.

 

0

Network, PowerShell, Server, Windows
If you’re running a webserver it may be you have to run different services on the same port and need to use multiple IP addresses on the same network interface. This can happen for SMTP or Exchange Servers using several connectors.

In Server 2008 (don’t ask me why Micrososft did that) and as well as in Server 2012 the source IP address on a network interface will always be the lowest IP address, in this case, the latest you’ve added.

So what do you have to do now is to set a flag on the particular IP address to say: ” Hey you, please don’t be the primary source address!” and this happens with the help of netsh.exe command.

You can view the status of all of your IP address and their status with following command:

The IP address which should not act as a primary source address needs to be flagged with SkipAsSource=true. As this command is only working while adding a new address but you want to have this flag enabled at one of your IP addresses, you first have to remove it and then add it again with this command:

First, with the help of the SkipAsSource flag it instructs Windows not to use this IP as primary source IP and secondly, it prevents its registration in DNS (if dynamic registration is enabled).
0

PowerShell, Server, VMWare, Windows
Hi there, following function Get-ScsiDisks retrieves disk details for VMWare Guests or any computer with corresponding SCSI disk details like SCSI ID and SCSI Bus. The function concatenates objects consisting of Win32_DiskDrive, Win32_LogicalDisk and Win32_DiskDriveToDiskPartition using WMI. For WinRM you can use Invoke-Command and inject the script.

Output:

0