469,925 Members | 1,475 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

logon on remote computer outside domain

Hajo,

I am searching solution for this proble over 2 days.
I need to be able to create mailboxes on exchange server
that is in domain. I need to do it outside of domain.
What is more I can create user outside domain but I can not
create mailbox. Below code throws following exception:
The server is not operational.

IMailboxStore mailBox = (IMailboxStore)user.NativeObject;
mailBox.CreateMailbox(..); <- exception

thanks in adcenve for any help
Gawel

Nov 16 '05 #1
6 10553
Please, post some more code, we can't help you when you don't give us the
LDAP URL in:
mailBox.CreateMailbox(..);

Willy.

"Gawel" <gawelek@SPAM_NO_NON_NOgazeta.pl> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
Hajo,

I am searching solution for this proble over 2 days.
I need to be able to create mailboxes on exchange server
that is in domain. I need to do it outside of domain.
What is more I can create user outside domain but I can not
create mailbox. Below code throws following exception:
The server is not operational.

IMailboxStore mailBox = (IMailboxStore)user.NativeObject;
mailBox.CreateMailbox(..); <- exception

thanks in adcenve for any help
Gawel

Nov 16 '05 #2
Willy Denoyette [MVP] wrote:
Please, post some more code, we can't help you when you don't give us the
LDAP URL in:
mailBox.CreateMailbox(..);


Hajo Willy, below I present my code.

DirectoryEntry users = new
DirectoryEntry("LDAP://10.7.0.10/CN=Users,DC=company,DC=local",
"CN=Administrator,CN=Users,DC=company,DC=local ",
"password", AuthenticationTypes.ServerBind);

DirectoryEntry user = users.Children.Add("cn=JanKowalski", "user");
user.CommitChanges();
user.Properties["samAccountName"].Value = "JanKowalski";
// enable user: 0x200 ADS_UF_NORMAL_ACCOUNT
// password never expires: 0x10000 ADS_UF_DONT_EXPIRE_PASSWD
user.Properties["userAccountControl"].Value = 0x200 | 0x10000;
user.Invoke("SetPassword", new Object[]{"@@#$%qweqwerA1"});
user.CommitChanges();
ActiveDs.IADsUser adsiUser = (ActiveDs.IADsUser)user.NativeObject;
adsiUser.AccountDisabled = false;

// THIS PART I CAN NOT EXECUTE FROM OUTSIDE OF THE DOMAIN
IMailboxStore mailBox = (IMailboxStore)user.NativeObject;
mailBox.CreateMailbox("CN=Mailbox Store (SPAMERSKI),CN=First Storage
Group,CN=InformationStore,CN=SPAMERSKI,CN=Servers, CN=First
Administrative Group,CN=Administrative Groups,CN=Software
Company,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=company,D C=local");

user.CommitChanges();
thanks for quick reply

Gawel
Nov 16 '05 #3
Not sure but I guess you need the LDAP://DCServer provider moniker in your
URL.

mailBox.CreateMailbox(LDAP://domainController/CN=Mailbox Store.....)

Willy.

"Gawel" <gawelek@SPAM_NO_NON_NOgazeta.pl> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...
Willy Denoyette [MVP] wrote:
Please, post some more code, we can't help you when you don't give us the
LDAP URL in:
mailBox.CreateMailbox(..);


Hajo Willy, below I present my code.

DirectoryEntry users = new
DirectoryEntry("LDAP://10.7.0.10/CN=Users,DC=company,DC=local",
"CN=Administrator,CN=Users,DC=company,DC=local ",
"password", AuthenticationTypes.ServerBind);

DirectoryEntry user = users.Children.Add("cn=JanKowalski", "user");
user.CommitChanges();
user.Properties["samAccountName"].Value = "JanKowalski";
// enable user: 0x200 ADS_UF_NORMAL_ACCOUNT
// password never expires: 0x10000 ADS_UF_DONT_EXPIRE_PASSWD
user.Properties["userAccountControl"].Value = 0x200 | 0x10000;
user.Invoke("SetPassword", new Object[]{"@@#$%qweqwerA1"});
user.CommitChanges();
ActiveDs.IADsUser adsiUser = (ActiveDs.IADsUser)user.NativeObject;
adsiUser.AccountDisabled = false;

// THIS PART I CAN NOT EXECUTE FROM OUTSIDE OF THE DOMAIN
IMailboxStore mailBox = (IMailboxStore)user.NativeObject;
mailBox.CreateMailbox("CN=Mailbox Store (SPAMERSKI),CN=First Storage
Group,CN=InformationStore,CN=SPAMERSKI,CN=Servers, CN=First
Administrative Group,CN=Administrative Groups,CN=Software
Company,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=company,D C=local");

user.CommitChanges();
thanks for quick reply

Gawel

Nov 16 '05 #4
Willy Denoyette [MVP] wrote:
Not sure but I guess you need the LDAP://DCServer provider moniker in your
URL.

mailBox.CreateMailbox(LDAP://domainController/CN=Mailbox Store.....)


Hajo,
when I add "LDAP://domainController" prefix then I get
invalid parameter exception.

thanks for your effort

Gawel
Nov 16 '05 #5
Make sure your URL looks like
"LDAP://DCServer/CN=...."

Note DCServer is your DC server name/

Willy.

"Gawel" <gawelek@SPAM_NO_NON_NOgazeta.pl> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Willy Denoyette [MVP] wrote:
Not sure but I guess you need the LDAP://DCServer provider moniker in
your URL.

mailBox.CreateMailbox(LDAP://domainController/CN=Mailbox Store.....)


Hajo,
when I add "LDAP://domainController" prefix then I get
invalid parameter exception.

thanks for your effort

Gawel

Nov 16 '05 #6
Willy Denoyette [MVP] wrote:
Make sure your URL looks like
"LDAP://DCServer/CN=...."

Note DCServer is your DC server name


hajo,

I added LDAP://spamerski/ and then LDAP://spamerski.company.local/
(domain name is company.local, spamerski.company.local is domain
controller)
and always I get System.ArgumentException: The parameter is incorrect :(
Gawel

Nov 16 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by news.microsoft.com | last post: by
1 post views Thread by Angelo Castigliola III | last post: by
3 posts views Thread by Sateesh | last post: by
14 posts views Thread by John J. Hughes II | last post: by
reply views Thread by Matt | last post: by
reply views Thread by robpimentel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.