1

I am running this command to find out when a license will expire on a set of servers:

cscript c:\Windows\System32\slmgr.vbs $server /xpr | Add-Content $LogFile

The output that is written to the LogFile looks like this:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Windows Server(R), ServerStandard edition:
    Volume activation will expire 6/15/2014 1:12:33 PM

How can I remove the first three line in the output text file?

0

2 Answers 2

3

Try adding the nologo directive.

cscript //nologo c:\Windows\System32\slmgr.vbs $server /xpr | Add-Content $LogFile

Sign up to request clarification or add additional context in comments.

2 Comments

Wow, it was that easy. Thank you so much for your quick response.
@user3120098 You can save it as the default command-line option by running cscript //NoLogo //s.
0

I would use //nologo. This option strips out the windows stuff and leaves you just the info you're looking for. If you still want a more precise output, try using regular expressions. Your ending command should look like this:

cscript //nologo c:\Windows\System32\slmgr.vbs $server /xpr | Add-Content $LogFile

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.