0

Tips & Tricks : CMD Batch parameters

-

Handful list of parameters possible to use in CMD scripts:

%~I         - expands %I removing any surrounding quotes ("")
%~fI        - expands %I to a fully qualified path name
%~dI        - expands %I to a drive letter only
%~pI        - expands %I to a path only
%~nI        - expands %I to a file name only
%~xI        - expands %I to a file extension only
%~sI        - expanded path contains short names only
%~aI        - expands %I to file attributes of file
%~tI        - expands %I to date/time of file
%~zI        - expands %I to size of file
%~$PATH:I   - searches the directories listed in the PATH
environment variable and expands %I to the
fully qualified name of the first one found.
If the environment variable name is not
defined or the file is not found by the
search, then this modifier expands to the
empty string

%~1         - expands %1 removing any surrounding quotes (")
%~f1        - expands %1 to a fully qualified path name
%~d1        - expands %1 to a drive letter only
%~p1        - expands %1 to a path only
%~n1        - expands %1 to a file name only
%~x1        - expands %1 to a file extension only
%~s1        - expanded path contains short names only
%~a1        - expands %1 to file attributes
%~t1        - expands %1 to date/time of file
%~z1        - expands %1 to size of file
%~$PATH:1   - searches the directories listed in the PATH
environment variable and expands %1 to the fully
qualified name of the first one found.  If the
environment variable name is not defined or the
file is not found by the search, then this
modifier expands to the empty string

%~dp1       - expands %1 to a drive letter and path only
%~nx1       - expands %1 to a file name and extension only
%~dp$PATH:1 - searches the directories listed in the PATH
environment variable for %1 and expands to the
drive letter and path of the first one found.
%~ftza1     - expands %1 to a DIR like output line

Very useful for automated software installations for example.

0

Tips & tricks : Detect your public IP using telnet

-

If you need to identify your public IP and have no possibility to run web browser of any kind you can use telnet.

In order to identify public IPv4:

telnet v4address.com

In order to identify public IPv6:

telnet v6address.com

Once connection is established autoresponder will show your public IP address:

This is the telnet autoresponder at v6address.com.
You have connected over IPv4.
Your IP address is 5.10.15.20

This might be helpful when using console on some *NIX systems or on the routers.

0

How-To : System Center 2012 SP1 Service Manager Installation

-

Quick reference with screenshots and requirements for System Center 2012 SP1 Service Manager installation.

(more…)

3

How-To : Promote Windows Server 2012 Core to first Domain Controller in Forest

-

In order to create new Forest and promote Windows Server 2012 Core to be Domain Controller for that Forest, first Active Directory Services Role has to be added:

Install-WindowsFeature AD-Domain-Services –IncludeManagementTools

Once Active Directory DOmain Services role is installed we can promote server to be first Domain Controller in the Forest.

Install-ADDSForest -DomainName "lab.corp" -DomainNetbiosName "LAB" -DomainMode Win2008R2 -ForestMode Win2008R2 -InstallDns -Force

And after some time new Forest and Domain Controller is ready to use.

0

How-To : Prep to SCCM 2007 R2 to SCCM 2012 SP1 Migration

-

Quick steps which should be done as pre-migration steps when you want to migrate System Center Configuration Manager 2007 R2 to System Center 2012 SP1 Configuration Manager.

Diagram below shows schematics of the lab environment prepared for migration testing.

SCCM Migration from 2007 to 2012

(more…)

0

Tips & Tricks : SQL Server “Cannot connect to WMI provider”

-

Recently I had issue which occured without any particular reason on SQL Server 2012. All of the sudden I start getting error message:

Cannot connect to WMI provider. You do not have permission or the server is
unreachable.
Note that you can only manage SQL Server 2005 servers with SQL
Server Configuration Manager.
Invalid Namespace.

when tried to run SQL Server Configuration Tools.

What resolved situation is command:

mofcomp C:\Program Files\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof