473,788 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

removing sidHistory

Hi All,

Have anyone tried to remove sidHistory using C#?

I keep getting the following error when I use the PutEx method.

System.Runtime. InteropServices .COMException was unhandled
Message="Unspec ified error\r\n"
Source="Active Directory"
ErrorCode=-2147467259
StackTrace:
at ActiveDs.IADs.P utEx(Int32 lnControlCode, String bstrName, Object
vProp)
Thanks,
Alex


Jun 27 '08 #1
3 3571
Hi Alex,

As for cleaning sidhistory, so far what I found is the following kb article
which provide the vbscript for cleaning sidhistory:

#How To Use Visual Basic Script to Clear SidHistory
http://support.microsoft.com/?id=295758

have you tried using VB.NET code which maybe easy to convert from vb. Or
you can consider keep the vbs script and use C# to programmtically invoke
cmd to execute the vbscript.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: <EF@nospam.nosp am>
Subject: removing sidHistory
Date: Fri, 25 Apr 2008 00:08:49 +0800

Hi All,

Have anyone tried to remove sidHistory using C#?

I keep getting the following error when I use the PutEx method.

System.Runtime .InteropService s.COMException was unhandled
Message="Unspec ified error\r\n"
Source="Active Directory"
ErrorCode=-2147467259
StackTrace:
at ActiveDs.IADs.P utEx(Int32 lnControlCode, String bstrName, Object
vProp)
Thanks,
Alex


Jun 27 '08 #2
Hi Steven,

Yup, I have seen that KBA before. I agree that it should be easier to
convert vbscript to VB.Net but since I am learning C# so I thought of doing
it in C#. Anyway, I have get it working.

Thanks,
Alex

"Steven Cheng [MSFT]" wrote:
Hi Alex,

As for cleaning sidhistory, so far what I found is the following kb article
which provide the vbscript for cleaning sidhistory:

#How To Use Visual Basic Script to Clear SidHistory
http://support.microsoft.com/?id=295758

have you tried using VB.NET code which maybe easy to convert from vb. Or
you can consider keep the vbs script and use C# to programmtically invoke
cmd to execute the vbscript.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: <EF@nospam.nosp am>
Subject: removing sidHistory
Date: Fri, 25 Apr 2008 00:08:49 +0800

Hi All,

Have anyone tried to remove sidHistory using C#?

I keep getting the following error when I use the PutEx method.

System.Runtime. InteropServices .COMException was unhandled
Message="Unspec ified error\r\n"
Source="Active Directory"
ErrorCode=-2147467259
StackTrace:
at ActiveDs.IADs.P utEx(Int32 lnControlCode, String bstrName, Object
vProp)
Thanks,
Alex


Jun 27 '08 #3
Note that you should not translate VBScript samples to C# or any .NET
language for that matter), .NET offers a rich class library to be used from
managed code, these class libraries make it much easier to access AD objects
than it was ever possible from unmanaged code.
The .NET way to clear the SID-History looks something like this:

using(Directory Entry root = new DirectoryEntry( @"LDAP://RootDSE"))
{
string defCtx =
root.Properties["defaultNamingC ontext"][0].ToString();
using(Directory Entry re = new DirectoryEntry( "LDAP://" +
defCtx))
{
PropertyValueCo llection sidH =
re.Properties["sidHistory "];
if(sidH.Count 0)
{
sidH.Clear();
re.CommitChange s();
}
}
}

Willy.

"Alex" <EF@nospam.nosp amwrote in message
news:A9******** *************** ***********@mic rosoft.com...
Hi Steven,

Yup, I have seen that KBA before. I agree that it should be easier to
convert vbscript to VB.Net but since I am learning C# so I thought of
doing
it in C#. Anyway, I have get it working.

Thanks,
Alex

"Steven Cheng [MSFT]" wrote:
>Hi Alex,

As for cleaning sidhistory, so far what I found is the following kb
article
which provide the vbscript for cleaning sidhistory:

#How To Use Visual Basic Script to Clear SidHistory
http://support.microsoft.com/?id=295758

have you tried using VB.NET code which maybe easy to convert from vb. Or
you can consider keep the vbs script and use C# to programmtically invoke
cmd to execute the vbscript.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

============== =============== =============== ======
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
============== =============== =============== ======
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>From: <EF@nospam.nosp am>
Subject: removing sidHistory
Date: Fri, 25 Apr 2008 00:08:49 +0800

Hi All,

Have anyone tried to remove sidHistory using C#?

I keep getting the following error when I use the PutEx method.

System.Runtime .InteropService s.COMException was unhandled
Message="Unspec ified error\r\n"
Source="Active Directory"
ErrorCode=-2147467259
StackTrace:
at ActiveDs.IADs.P utEx(Int32 lnControlCode, String bstrName,
Object
vProp)
Thanks,
Alex




Jun 27 '08 #4

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

Similar topics

3
3115
by: Jeremy Owens-Boggs | last post by:
We are trying to implement a dual list box selection where you have two list boxes, You highlight items in the right side list box, click a button and this moves those items over to the left hand list box. The problem is that if there are many items selected (thousands), then removing the items from the right side list box takes for ever because we are removing them one at a time, which causes the listbox to re-index everything before we...
0
2474
by: sameer mowade via .NET 247 | last post by:
Hello All, I have problem while dynamically removing row from the Datagrid which i have added dynamically as shown in the following code snippet. The problem is that while removing dynamically added row it also removes the row at the end along with the added row. Plz tell me if, I am missing any thing. Code </asp:datagrid>
66
4148
by: Cor | last post by:
Hi, I start a new thread about a discussion from yesterday (or for some of us this morning). It was a not so nice discussion about dynamically removing controls from a panel or what ever. It started by an example from me, that was far from complete and with typing errors, but basically it had the meaning to show that removing controls reversible was the nicest method. This was a lets say conclusion (but what is that in a newsgroup) in a...
3
4739
by: kevin | last post by:
Is that even possible? I am creating a web service in .NET to expose some already created .NET programs to other groups. One group is writing the client in PERL, and thus wishes the wsdl schema to not be sequenced. (PERL hashes do not retain order information) First, the w3 specs don't mention the sequence in any detail - its just there in the examples, which makes me wonder if removing the sequence tag is even supportable. Second,...
3
1315
by: Nathan Sokalski | last post by:
I am having trouble removing cookies that I created with my site. Here is the code I am using to try and remove them: If Not Request.Cookies("username") Is Nothing Then Response.Cookies.Remove("username") If Not Request.Cookies("password") Is Nothing Then Response.Cookies.Remove("password")
9
1652
by: clintonG | last post by:
The Barnes & Noble stores in and around Milwaukee, Wisconsin have removed or are removing all of the Microsoft platform programming and support magazines from their shelves. Not one single magazine related to any Microsoft operating system, any programming language and framework or any application remains on the shelves. All of the Linux and Mac magazines remain of course. Store clerks say "the buyer" made the decision and offered no...
6
6116
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or more minutes. 'REMOVE DUBLICATED VALUE FROM ARRAY +++++++++++++++++ Dim col As New Scripting.Dictionary Dim ii As Integer = 0
2
2149
by: techi_C | last post by:
Hi I'm getting a problem while removing semaphore from system. Before removing semaphore I'm checking the usage count of a smaphore. // checking usage count usage_count = semctl(sem_ptr->semid, 1, GETVAL, NULL); if( usage_count 1 ) // return don't remove semaphore else
7
2845
by: =?Utf-8?B?Sm9lbCBNZXJr?= | last post by:
I have created a custom class with both value type members and reference type members. I then have another custom class which inherits from a generic list of my first class. This custom listneeds to support cloning: Public Class RefClass Public tcp As TcpClient Public name As String End Class Public Class RefClassList Inherits List(Of RefClass) Implements ICloneable
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.