We help IT Professionals succeed at work.

Check out this week's podcast, "Dairy Farms to Databases: Community's Hand in Technology"Listen Now

x

Dump NPS logs

1,023 Views
Last Modified: 2014-11-22
How can I dump the events or logs for "Network Policy and Access Services" to a text file ?
Comment
Watch Question

Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
Manually, you can navigate to any event log, right-click and do a "Save All Events As."  Your Save As options are:

1. evtx
2. xml
3. txt
4. csv

Or are you looking for a script?

Dan
Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
If you are looking for events with specific event IDs or from a specific source, you can go to the appropriate event log and use the "Filter Current Log" function to select the desired events.  After finding the desired info, use the "Save Filtered Log File As" function to drop those events into files types mentioned above.

Dan
soffcecManager

Author

Commented:
Well I need script for this, if have been trying to use wevtutil  and netsh, but not found a way to dump the NPS events.
Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
Have you tried using the plain old Event Viewer?  My posts above are based on using it.

Are you comfortable with PowerShell?

Dan
soffcecManager

Author

Commented:
Yes, but I need to schedule the running of the event dump. PS is ok. I have done this for long time in Windows 2003 but I cant find out how to do this in Windows 2012R2 and I only need the logs for the NPS
Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
OK, so a litte more info is needed:

1. the scheduled task is run how often?
2. what timeframe should be in the output file?  last 24 hours, last 12h, or all...
3. what event ids or what event source are you looking for?
--- I understand NPS events, but since you've done it before it would be helpful to now exactly what you pulled
4. CSV format?

Dan
soffcecManager

Author

Commented:
DonĀ“t worry about the schedule, I just need wevtutil  and netsh command syntax to dump the NPS events to text file, no matter what format (.cvs,.txt)
I have never dumps NPS events in Server 2003, this is the first time I try to dump them.
On the 2003 server I was dumping other events.
Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
Have you enabled NPS logging?

Link: http://msdn.microsoft.com/en-us/library/cc730677.aspx

If so, it logs to a text located, by default, at:  systemroot \System32\LogFiles.  You can configure this log to rotate on the regular basis.  See above link.

Here is the netsh nps command reference:  http://technet.microsoft.com/en-us/library/cc754758(v=ws.10).aspx

Here is the wevtutil command reference:  http://technet.microsoft.com/de-de/library/cc732848(v=ws.10).aspx

Dan
soffcecManager

Author

Commented:
The NPS logging does not log anything, I prefer to use the event viewer logs.

I have checked out both aobove links before, As I said, I need the syntax for netsh or wevtutil to dump the event viwer NPS
Technical Lead - Active Directory
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
soffcecManager

Author

Commented:
Humm , not undestandig this error,

C:\Netuse>wevtutil qe NpsQuery.xml /sq:true /f:text
Failed to open event query. The specified xml text was not well-formed. See Extended Error for more details.
Dan McFaddenTechnical Lead - Active Directory
CERTIFIED EXPERT

Commented:
Error is from the way the xml file content was saved.  I'll guess you used Notepad to save the file.  I suggest that you use another text editor like Notepad++ or Programmer's notepad, either of these text editors will save the file properly.

Dan
soffcecManager

Author

Commented:
Now I have tried to save the text with EditPlus and Notepad++ but get the same error

When I try to import to Custom View I get the error "The specified custom view is not valid."
soffcecManager

Author

Commented:
It is working now. I replaced the double quote with double quote.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.