I have tried 2 ways (changing CN parameter and movehere) to rename a user in AD, without success. Everything else works (changing name, surname, alias...)
Help appreciated,
Marius
From the MSDN on IADsContainer::MoveHere:
The IADsContainer::MoveHere method can
be used either to rename an object
within the same container or to move
an object among different containers.
Moving an object retains the object
RDN, whereas renaming an object alters
the RDN.
For example, the following code
example performs the rename action.
set cont = GetObject("LDAP://dc=dom,dc=com")
set newobj = cont.MoveHere("LDAP://cn=Jeff Smith,dc=dom,dc=com", "cn=Denise Smith")
Related
I have created custom user property in Outlook called "Ownership". When someone from the team claim ownership of an email, person's name is saved as its value.
My question, is there any way to enumerate all the values of this custom property into combo box.
In simple words, get a list of all team members names (whoever has claimed ownership of an email in inbox folder).
I want to do something like this.
Outlook.UserDefinedProperties userDefinedProperties = null;
Outlook.UserDefinedProperty userDefinedProperty = null;
Outlook.MAPIFolder currentFolder = application.ActiveExplorer().CurrentFolder;
mailUserProperties = currentFolder.UserDefinedProperties;
mailUserProperty = mailUserProperties["Ownership"];
// Filling up the combo box
PersonCombo.Items.Add(userDefinedProperty.Value);
I want to use current folder because folder will have all the values while an email can only have one value of the custom property.
If this is not possible, is there any other way to get it done?
Thank you in advance.
There isn't a single query that will return all unique values of a particular named property. The best you can do is search for all items where the property exists (not null), and then build a list of unique values.
I do not think, however, this is a good of storing possible values - it really must be a single source, such as a particular GAL distribution list, or a hidden (associated) message in the folder that stores all possible values in a single property.
Thanks everyone for your input.
At the end, I ended up creating GAL distribution list as Dmitry suggested and used it for my purpose.
Outlook COM has a method under Application.Session.GetAddressEntryFromID method to grab an address entry without having to iterate through the entire Global or All Users address book.
The issue is it is expecting the ID that an entry has under the AddressLists object.
In Active Directory, there is no equivalent that gives me the same GetAddressEntryFromId string.
I was previously making a list of all users, minus rooms and resources, by going through the entire COM object, but that takes too long; 20mins.
I figured if I use AD, which is faster, with filters to find the users, then I can grab the GUID and when looking for info on the user, not have to go through the entire COM object to grab it, but it will happen locally to the executable being run.
The issue I am having, as an example, is that I have a user with the following ID;
00000000DCA740C8C042101AB4B908002B2FE18201000000000000002F6F3D45766572657374205265696E737572616E63652F6F753D436F72702D48512F636E3D526563697069656E74732F636E3D6A6E6700
In AD the msExchMailboxGuid has a value of
{4A49BD1C-62AE-4674-B097-C06528BDBEAE}
Not sure if these are the same, but I need to learn to better save it.
What else can I use, what can I do with the current time?
GAL entry id is constructed from the EX address (which is stored in the legacyDN attribute).
The entry id you have above contains the following:
The following is a basic drools syntax:
$customer : Customer( )
Account( ) from $customer.accounts
As far as I know the first line create a new variable and assign it to the fact.
However I can't quite understand the second line especially what the "Account()" part means...
You have written class Customer, or must know it to understand what's going on here. Presumably it contains a Collection<Account> accounts (see note), which is (by the engine) retrieved one by one so that the rule fires for each Account object contained in Customer's object.
The rule will fire once for each Account object stored in any of the collections contained in all the Customer facts in working memory, with $customer being bound to the containing Customer.
You can bind another variable to Account.
Note: It could also contain a field Account accounts, but I hope the name was chosen carefully.
I’m using Coldfusion MX 8. I recently had a situation where variables seem to be “swapping” between sessions. I found some information regarding entire sessions swapping, but this was not the case. It was just one variable being swapped, not the entire session. My code snippets follow:
var idArray = ListToArray(arguments.event.getArg("itemIDs"));
var oItemDetail = 0;
var oItem = 0; //Inserting this line seems to have fixed the error.
var i = 0;
for (i=1;i lte ArrayLen(idArray);i=i+1) {
//Log Spot #1 – cflog idArray[i] and arguments.event.getArg("statusNotes")
oItem = getItemService().getItem(idArray[i]);
oItemDetail = getItemService().getItemDetail();
oItemDetail.setItemID(oItem.getItemID());
oItemDetail.setStatusNotes(arguments.event.getArg("statusNotes"));
getItemService().saveItem(oItem);
getItemService().saveItemDetail(oItemDetail);
}
//getItem and getItemDetail just call getTransfer().get()
//saveItem and saveItemDetail just call getTransfer().save()
For example, at Log Spot #1, idArray[i] might have been “1”, and the StatusNotes event arg might be “abc”.
But should another person, in another session, using another login, in another place, another browser, etc.etc. Use the function at exactly the same time, using idArray[i] = “2” and statusNotes = “def”, then Item Detail “abc” might instead attach to Item “2”, and Item Detail “def” attach to Item “1”.
The fact that, at Log Spot #1, the variables logged are correct, but in the database they are swapped, points to these lines of code as the suspects.
This problem has gone away by declaring “var oItem” at the top.
So I guess I’m a little shocked by this revelation. I would assume that not declaring my local variables would mean another variable, with the same name, in another function, but in the same session might get overwritten. But this seems to be some sort of internal memory issue. The variables are not even being overwritten, rather swapped, between sessions!
I was wondering if anyone had any similar experiences and could shed some light on this?
Unvar'd variables are made private variables within the object that they are contained in. Which causes two problems,
They are shared (accessed and written to) by functions (within that same component)
They live beyond the life of the function call
When you var a variable it makes it a local variable only to that function. Only that function can use it and it only lives as long as that function does.
In your case, this problem doesn't really have anything to do with sessions, other than that is the persistent scope where you happen to be storing the data from these functions.
You said
I would assume that not declaring my local variables would mean another variable, with the same name, in another function, but in the same session might get overwritten.
But it would be more accurate to say
I would assume that not declaring my local variables would mean another variable, with the same name, in another function, but in the same OBJECT might get overwritten.
I'm trying to figure out how to add a local group to an (On-Demand) Publishing Point, with vbscript.
The group just needs read access to it. The group has (of course) been created first.
System: Windows Server 2008 R2 x64 with Media Services 2008 (for R2). It's not a Domain Controller, there's no Active Directory.
Context: Running a media server with one Pub. Point per movie, and use the group to allow/deny access to that Pub. Point / movie on a per-user basis.
I can add the group manually, but I would really like to do it with a (vb)script.
To do it manually:
(first create a local group).
In Server Manager, click the on-demand Publishing Point, Properties tab, Authorization, WMS Publishing Points ACL Authorization (which of course has to be enabled), right-click it - choose Properties.
Strangely, Groups are by default not enabled in Object Types, so one has to specifically enable them to be able to add the group.
The closest example I've been able to find is this: (it's in VB.Net)
http://msdn.microsoft.com/en-us/library/dd875036%28v=VS.85%29.aspx
My (almost-working) script so far:
Dim Server
Dim ODPubPoint
Dim Plugin
Dim ACLCheckAdmin
Dim AccessCtrlList
Dim objACE
' Create a new WMSServer object.
Set Server = CreateObject("WMSServer.server","localhost")
' Create a new ODPubPoint object.
Set ODPubPoint = Server.PublishingPoints.Item("supersizeme")
' Retrieve the plug-in to be configured.
Set Plugin = ODPubPoint.EventHandlers.Item("WMS Publishing Points ACL Authorization")
' Retrieve the custom interface of the plug-in.
Set ACLCheckAdmin = Plugin.CustomInterface
' Retrieve the list of access control entries.
Set AccessCtrlList = ACLCheckAdmin.AccessControlList
' Create an object to be able to add to the access control list.
Set objACE = CreateObject("AccessControlEntry")
objACE = AccessCtrlList.Add("MEDIESERVER\hest", 16 )
The group does get added, but the script dies with an error:
ppaddgroup.vbs(27, 2) Microsoft VBScript runtime error: Object doesn't support this property or method.
In the VB.Net example it says WMS_ACCESS_CONTROL.WMS_ACL_ALLOW_ALL which I have no idea how to convert from VB.Net to VBScript. I thought it was just a constant, but apparently not.
(and I just want to allow read access, as in WMS_ACL_ALLOW_READ ).
I found the constants on this page:
http://include.wutils.com/com-dll/constants/constants-WMSServerLib.htm
Can anyone come up with the correct way to add a group to a publishing point?
Per greylion's previous edit:
The last line needs to be:
Set objACE = AccessCtrlList.Add("MEDIESERVER\test", 16 )
For some reason, I was convinced that the final act of adding the
group was not supposed to have a "Set" in front. I thought it was only
for creating or defining objects, but apparently it's also for filling
them with actual data. Annoyingly, it almost worked with "Set"
missing, which led me to think I just had some minor detail wrong, but
no way to know what it was.
Mental note: Filling an object with data is NOT like setting a
variable or constant.