473,408 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

ReplacementStrings on EventLog entries Messages

Hi All,

I need help with ReplacementStrings on EventLog messages.

The question is: How to replace things such %{SID} and %{GUID} inside
EventLogEntry.Message?

When the case is %{SID}, I solved by using SecurityIdentifier and
IdentityReference classes. But when the case is %{GUID}, few times I have
lucky with the DirectorySearcher class by converting the GUID to NativeGuid
format. However, almost times I have null results.

I think that this way is far from the correct way to deal with this problem.
But I don't know how.

Thanks in Advance

Washington Moreira
Apr 24 '06 #1
7 3109
Hello,

As I understand, you want to log some messages in eventlog, but I am not
very clear about %{SID} and %{GUID} you mentioned. GUID or NativeGuid are
objects in System.DirectoryServices Namespace. Did you want to log them in
eventlog? Can you explain more on this?

Thanks,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 25 '06 #2
Hi Luke Zhang,
Tks for your attention.

Example of %{SID} on Security Log Messages:
Target Account ID: %{S-1-5-21-3318669157-2336031042-2875015298-1604}

Example to what I think that would be a %{GUID} on Security Log Messages:

Properties:
---
%{bf967aad-0de6-11d0-a285-00aa003049e2}

So, how to replace these %{something} strings with the real object names?

Best Regards
Washington Moreira

"Luke Zhang [MSFT]" wrote:
Hello,

As I understand, you want to log some messages in eventlog, but I am not
very clear about %{SID} and %{GUID} you mentioned. GUID or NativeGuid are
objects in System.DirectoryServices Namespace. Did you want to log them in
eventlog? Can you explain more on this?

Thanks,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 25 '06 #3
Do you mean properties like "logon guid" in security event log? They are
not always with a actual value. If you want to find an object with a GUID.
You may search by ObjectGUID.

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 26 '06 #4
Hi Luke,
To be more clear, please look the following example from Security Log -
Directory Service Access - Event ID 566:
----------------------------------------------------------------------------------------------
Object Operation:
Object Server: DS
Operation Type: Object Access
Object Type: %{bf967a9c-0de6-11d0-a285-00aa003049e2}
Object Name: %{4ca867ab-860a-43b6-a27b-ab1ecf631296}
Handle ID: -
Primary User Name: ALIENIII$
Primary Domain: LIFE
Primary Logon ID: (0x0,0xAAA)
Client User Name: someUser
Client Domain: someDomain
Client Logon ID: (0x0,0xBBBB)
Accesses: %Write Property
Properties:
%Write Property
%{bc0ac240-79a9-11d0-9020-00c04fc2d4cf}
%{bf9679c0-0de6-11d0-a285-00aa003049e2}
%{bf967a9c-0de6-11d0-a285-00aa003049e2}
Additional Info:
Additional Info2:
Access Mask: 0x20
----------------------------------------------------------------------------------------------
By checking the ReplacementStrings, " Object Name:
%{4ca867ab-860a-43b6-a27b-ab1ecf631296}", is in fact an objectGUID from
domain partition (an user in this case), but the others as "Object Type" and
"Properties" do not return anything, if searching with objectGUID on domain
partition or on the schema.

Today, by searching Google I saw that some strings can be schemaIDGUID and
not objectGUID. But how to know which is each case?
When searching should be did on domain by objectGUID or by schemaIDGUID on
schema?

Thanks in Advance
Washington Moreira

"Luke Zhang [MSFT]" wrote:
Do you mean properties like "logon guid" in security event log? They are
not always with a actual value. If you want to find an object with a GUID.
You may search by ObjectGUID.

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 26 '06 #5
Normally, Object Type can be queried by schemaIDGUID, but I am not sure
about the Properties. Can you get some results by querying by schemaIDGUID?

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 27 '06 #6
Hi Luke,

When %{GUID} refers to a Property Set, Extended-Rights or Validated Writes,
schemaIDGUID do not return anything. But for now, I think that if looking on
"CN=Extended-Rights,CN=Configuration,DC=domain,DC=com", the attribute
rightsGUID can answer this question.
For example %{bc0ac240-79a9-11d0-9020-00c04fc2d4cf} matches the rightsGUID
of Membership object under "CN=Extended-Rights" container.

More one place to search...:(

Thanks

Washington Moreira
"Luke Zhang [MSFT]" wrote:
Normally, Object Type can be queried by schemaIDGUID, but I am not sure
about the Properties. Can you get some results by querying by schemaIDGUID?

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 28 '06 #7
Hello,

I found a previous post, in which Max provided some valueble suggestions.
You may take a look to see if it can help:

http://groups.google.com/group/micro...rowse_thread/t
hread/3d3459a01c0965a4/d6c066b01e679686?lnk=st&q=%22Retrieve+Guids+from+a ttr
ibutes%2C+possible%22&rnum=1&hl=zh-CN#d6c066b01e679686

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 28 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
Anyone know how to deal with the ReplacementStrings from the LogEntry class? When you read a LogEntry.Messages that has extended characters or whatnot, it throws an exception about converstion...
5
by: | last post by:
I can´t find anything *usefull* about replacement strings, even on google! Anyone know how to deal with the ReplacementStrings from the LogEntry class? When you read a LogEntry.Messages that...
0
by: WalterB | last post by:
I am using the .net eventlog component to view eventlog entries on a local machine. For some reason, the eventID that the eventlog component is retrieving is different than the eventID that is...
1
by: Morris | last post by:
I create a custom log and write new entries to this log fine. However, at random time, I got error message error message like this "The description for Event ID ( 0 ) in Source ( MyCustomLog)...
0
by: aaa | last post by:
Is there any way to sort and order the EventLog entries using the EventLog object??
3
by: Ole Hanson | last post by:
Hi I am trying to engineer a way of testing that my logging framework is capable of writing to my eventlog. I want to include this test in my already existing NUnit tests - but I'm a little low...
6
by: Microsoft | last post by:
I'm creating a windows service with C#, but am having a huge amount of difficulties using the event log. In the design view of the service, I drop an EventLog component. I name the source the...
2
by: John Smith | last post by:
I have created a windows service that logs errors to the EventLog. I want the logs to go to an EventLog I have created. However, I am finding that the event is not logging to the created EventLog...
0
by: =?Utf-8?B?Y2FsZGVyYXJh?= | last post by:
Dear all, I am trying using .NEt 2.0 to create a custom Log entry under Vista OS, where I will place my log inoformation. For that I am doing as follow : First I am ckecking if the log...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.