473,498 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10956
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1055
by: news.microsoft.com | last post by:
I am trying to write to the registry of a remote computer that is not on a domain from a computer that is on a domain. I am trying to impersonate an administrator account that is on this remote...
1
4135
by: Angelo Castigliola III | last post by:
I am trying to write to the registry of a remote computer that is not on a domain from a computer that is on a domain. I am trying to impersonate an administrator account that is on this remote...
3
1600
by: Sateesh | last post by:
Hello, I have a .Net service registered in my machine and set Logon type as "This account" and gave my domain account name and it's password. It works fine and I am able to connect to a remote...
14
3355
by: John J. Hughes II | last post by:
I have "Computer A" which is running Win2K3 and MS SQL server. And "Computer B" which is running a service that I have created. If I change the service on "Computer B" to run as a user my program...
0
1256
by: Matt | last post by:
I have a web server that is located in a DMZ and is not part of my domain. I have a file server within the domain that processes files for clients. I have written a C# console application that...
3
3451
by: Gary K | last post by:
After a bit a trouble getting VS to create a project on a different web server (I forgot to apply the 'fix'), I get the following error when trying to debug my web application. Error while...
3
2545
by: rfontaine | last post by:
I have a virtual directory on IIS 5.0 to a remote share on a Windows 2003 file server. The "connect as" is a domain user account. The share as read permission for everyone and the NTFS permission...
1
16337
by: schaf | last post by:
Hi all! I'm still trying to start/stop a service on a remote computer. (I promiss that's the last new post because of this problem from my side) My situation: I've an application running under...
0
3208
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to...
0
7002
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
7379
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
5462
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,...
1
4908
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...
0
4588
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...
0
3093
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...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
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 ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.