but you could also use it to Sync the active accounts between AD and AX
static void ChangeDomain(Args _args)
{
UserInfo userInfo;
xAxaptaUserManager axUsrMgr;
xAxaptaUserDetails axUsrDet;
Boolean doUpdate;
Username user;
SID oldSID;
#define.NewDomain("New.DOMAIN.NET")
;
doUpdate = Box::yesNo("User aktualisieren?", DialogButton::No) == DialogButton::Yes;
axUsrMgr = new xAxaptaUserManager();
ttsbegin;
setPrefix('SID-Aktualisierung');
while select forupdate userInfo
{
axUsrDet = axUsrMgr.getDomainUser(#NewDomain,userInfo.networkAlias);
if(userInfo && axUsrDet)
{
oldSID = userInfo.sid;
userInfo.networkDomain = #NewDomain;
userInfo.sid = axUsrMgr.getUserSid(userInfo.networkAlias, #NewDomain);
if(doUpdate)
{
info(strfmt("Aktualisiert", userInfo.networkAlias));
userInfo.update();
}
}
else
{
error(strfmt("Nicht gefunden", userInfo.networkAlias));
}
}
ttscommit;
}
static void ChangeDomain(Args _args)
{
UserInfo userInfo;
xAxaptaUserManager axUsrMgr;
xAxaptaUserDetails axUsrDet;
Boolean doUpdate;
Username user;
SID oldSID;
#define.NewDomain("New.DOMAIN.NET")
;
doUpdate = Box::yesNo("User aktualisieren?", DialogButton::No) == DialogButton::Yes;
axUsrMgr = new xAxaptaUserManager();
ttsbegin;
setPrefix('SID-Aktualisierung');
while select forupdate userInfo
{
axUsrDet = axUsrMgr.getDomainUser(#NewDomain,userInfo.networkAlias);
if(userInfo && axUsrDet)
{
oldSID = userInfo.sid;
userInfo.networkDomain = #NewDomain;
userInfo.sid = axUsrMgr.getUserSid(userInfo.networkAlias, #NewDomain);
if(doUpdate)
{
info(strfmt("Aktualisiert", userInfo.networkAlias));
userInfo.update();
}
}
else
{
error(strfmt("Nicht gefunden", userInfo.networkAlias));
}
}
ttscommit;
}