|
That works but only for one person... But whenever I send it to multiple users via the PIPE "|" symbol it doesn't compute the the rest of the commands because they are put on as arguments. But when I do the batch file it doesn't do the multiline messaging so I'm stumped.
Please Help
|
|
|
|
|
This is just a problem of parsing command line arguments in your program. If you're sending to multiple people, then loop through the list of people and execute the command for each one.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
When I first built my program I did that. But it takes FOREVER.
So then I thought maybe I could distribute each person into a thread.. but that would be too hectic.
So I don't know what else to do?
BTW Thx for putting up with me
|
|
|
|
|
Just thread it. "net send" takes two or more parameters (besides switches) a single user or computername and the rest of the parameters are the message. There's no way around it.
Just use a worker thread (see the ThreadPool class), passing the user/computer name as the state variable and save the message to a member field. The thread execution method gets the username and gets the value from the message field and sends the message with "net send".
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I think that it is good try to use the following API :
NET_API_STATUS NetMessageBufferSend(
LPCWSTR servername,
LPCWSTR msgname,
LPCWSTR fromname,
LPBYTE buf,
DWORD buflen
);
try to import it to you class and use it , and i think that now you can send escap characters like /n /r .....
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Hi!
I'm writing an WinForm app in c# with VS2002 on win2000sp3 with mediaplayer9.
I have a Windows Media Player control that I added to my controlsbox
by going into the COM controls tab. This winmedplayer is embedded in the WinForm,
much like the 'Play' button, of course.
The problem I have is that whenever the application starts, it creates an exterior
Windows Media Player window that then loads the video and plays it in its own window.
My application just sits there behind with its own embedded media control that doesn't do
anything.
Here is the code for the load event of th app.:
private void frmMain_Load(object sender, System.EventArgs e)<br />
{<br />
string location;<br />
location = "C:\\Documents and Settings\\Administrateur\\Mes documents\\My Work\\Recherche et Developpement\\Videos et Audios\\Vidéo\\Q.AVI";<br />
axWinMedPlayer.openPlayer(location);<br />
}
So my question is: how may I play the video in the Windows Media Control that is embedded on my
Windows Form? -instead of having it played in a new Windows Media Player window independant of my app winform...
Thanks!
Antoine
This by our hands that dream,
"I shall find a way or make one!"
|
|
|
|
|
If you look at the documentation for openPlayer , it states that the media is opened in a new window. This is supposed to happen. Instead, assign the media source to the URL property for WM9.
You shoudl also download the Windows Media 9 SDK. It has a pretty good CHM with all sorts of information about embedding the player as well as the object model.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks!
I dont really know what I did, but now it works. And for now, that's enough for me.
I'll dig in later,
thans!
Antoine (prononced Antwone)
This by our hands that dream,
"I shall find a way or make one!"
|
|
|
|
|
I am trying to make a autometed image which will be image a new computer and add that computer domain. To do that I need to get avialble computer name from my database and change the current name and then add the computer to domain. I know how to add computer to domain but I don't know home to change the computer name. Can any one help me PL:
CJ
|
|
|
|
|
You can use SetComputerNameEx to change the computer name and NetRenameMachineInDomain to change the name in the domain. You can also simply call NetRenameMachineInDomain but you must supply a coputer name for the lpNewMachineName parameter.
See the PSDK for more details.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That mite work on good ol' win9x, but it wont with any NT based OS, as you will have duplicate SID (see MCSE docs whereever they may be) on the network and the domain controller will refuse to use then. Maybe there is some other way, perhaps look at the the Deployment sections in one of the Resourse Kits. Good luck
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I always use regsvcs.exe to get my COM+ assemblies registered. Some reading I have suggested otherwise: use sn.exe to give it a strong name, then use "regasm.exe" to get it registered.
What should I use? I have used regasm.exe only in creating a CCW. I don't understand why a COM+ component (one derived from ServicedComponent) need to use regasm.exe
Perhaps,
regsvcs.exe mycomponent.dll
achieves the same objective as:
regasm.exe mycomponent.dll
Confused.
|
|
|
|
|
|
Hello everybody!
I'm a beginner developer in .Net and I need to know if I can convert Bitmaps to Metafiles in anyway. ( The Save method of the Image Class does´nt work beetwen vectorial images and pixelized images ).
Advanced Thanks!
|
|
|
|
|
I'm not totally sure if this will work (Graphics are not my strong point), but give it a shot:
<br />
System.Drawing.Bitmap b = new System.Drawing.Bitmap("filename.bmp");<br />
System.IO.MemoryStream ms = new System.IO.MemoryStream();<br />
b.Save(ms, System.Drawing.Imaging.ImageFormat.Wmf);<br />
System.Drawing.Imaging.Metafile m = new System.Drawing.Imaging.Metafile(ms);<br />
I'm sure other people will have a better solution, but I think that will get you started.
HTH,
Bill P.
Oakland, CA
|
|
|
|
|
Be carefull by using this functions i thing that you are trying to convert an image form the raster format to vertor one so this prosess is not good to be done automatically you will get a file wich contain a data but not the correct data you want to deal with ... this converssion will produce a file with a point object for each pexile in the image so it is a meaningless information , i hoop that you cane use some softwares for degitizing like erdas or what ever....
the prove of my speaking that if you try that code you will get a WMF file but try to zoom in the picture you will get the pexiles rectangulars ....
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Thank you very much for reply my question, at the moment I haven't a right solution, but I'm going continous with my investigation. I will send information if I find something succesfully.
|
|
|
|
|
Hello people, i'm having a big trouble with this thing of creating user, i developed a code to create users in Active directory and mailenable it, i always worked fine, (developer platform: Windows XP, IIS 5), but now the project is finished, and i passed it into production, so what appen:
(production platform: Windows 2003 server, IIS6)
Running as a console it works fine, no problem, but i need some part to run as a webservice, and boom it blows up on me. various error messages but the most consistent is "Catastrophic Error".
Here is a simple code that i'm testing now, attention this works fine in IIS 5, and Windows XP, but not in IIS6, all permissions is set and ok.
public string CreateMailbox(string user)<br />
{<br />
try<br />
{<br />
StringBuilder sb = new StringBuilder();<br />
string ouDN = "LDAP://OU=domainuserOU,OU=GlobalOU,DC=LAB,DC=TASP,DC=LOCAL";<br />
DirectoryEntry deOU = new DirectoryEntry(ouDN,"Administrator","password",AuthenticationTypes.Secure | AuthenticationTypes.ServerBind);<br />
object obj = deOU.NativeObject;<br />
sb.AppendFormat("CN={0}",user);<br />
DirectoryEntry deUser = deOU.Children.Add(sb.ToString(),"user");<br />
deUser.Properties["sAMAccountName"].Add(user);<br />
sb = new StringBuilder();<br />
sb.AppendFormat("{0}@lab.tasp.local", user);<br />
deUser.Properties["userPrincipalName"].Add(sb.ToString());<br />
deUser.CommitChanges();<br />
deUser.Invoke("SetPassword","userpassword");<br />
deUser.CommitChanges();<br />
deUser.Properties["userAccountControl"].Value = 0x200;<br />
deUser.CommitChanges();<br />
IMailboxStore mailbox;<br />
obj = deUser.NativeObject;<br />
mailbox = (IMailboxStore)obj;<br />
mailbox.CreateMailbox("CN=SG1-DB1,CN=SG1,CN=InformationStore,CN=VMEX02,CN=Servers,CN=First Administrative Group," +<br />
"CN=Administrative Groups,CN=Portugal Telecom,CN=Microsoft Exchange,CN=Services,CN=Configuration," +<br />
"DC=lab,DC=tasp,DC=local");<br />
deUser.CommitChanges();<br />
}catch(Exception err)<br />
{return err.Message + err.StackTrace;}<br />
return "user created with success!";<br />
}
thank u veri much
|
|
|
|
|
Which line commonly throws the exception(s)?
Also, the first thing that comes to my mind is permissions. IIS6 on Win2K3 (like it comes with anything else currently! ) starts making effective use of code access security. I really haven't had time to play with it, but I have spent a lot of time from the 1.0 beta days of CAS so all I can do is give you pointers.
Make sure that the web service is allowed to run with permissions appropriate to what you're doing. For example, invoking anything (DirectoryEntry.Invoke ) requires the DirectoryServicesPermission so the web service must be granted that permission. How that's done for a web application in IIS6 is a bit of a mystery to me (if I ever have time to quite these constant last-minute changes from my PHB I will install it on our servers which need it anyway).
If it's not CAS, perhaps the Win2K3's membership doesn't grant it access to write to a AD?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
OK Forgot some issues, the object is created in the AD with perfection, everything works until....
mailbox.CreateMailbox("CN=SG1-DB1,CN=SG1,CN=InformationStore,CN=VMEX02,CN=Servers,CN=First Administrative Group," +<br />
"CN=Administrative Groups,CN=Portugal Telecom,CN=Microsoft Exchange,CN=Services,CN=Configuration," +<br />
"DC=lab,DC=tasp,DC=local");
this is when he trows an error of CATASTROPHIC ERROR
The permissions are set in the machine.config, and the impersonation is done by the DirectoryEntry Object, this is, when i initalize the object i provide the credentials of an domain admin user.
So permissions should be covered.
I also tried to place the impersonationcontext in, but it didn't work also...
Thx a lot, ricardo snatos
|
|
|
|
|
Actually, I wasn't talking about AD permissions, per se. I was speaking of code access security (CAS) permissions. For instance, does the CreateMailbox method documentation say anything about a required permission to execute? It's a question of whether or not your web application has been granted the required permissions. This isn't necessarily through the machine.config file, either. If I remember correctly from the VS.NET 2003 / Windows Server 2003 launch event, you can grant permissions to web applications through IIS's administrative tool. I'm sorry that I don't remember specifics. I'm hoping I have a chance to purchase and install Win2K3 for our Internet-deployed application (touchless installation) for better security and availability.
Also, have you tried turning tracing on in your Web.config file and checking the app's trace log (trace.axd from the app root)? Does it give any more details or a stack trace that might point to the exact error? If its a catastrphic failure, of course, you might not get this.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok thx for the tips, it fix the problem that was permissions of course, so here is the way to work;
It's all on IIS 6.
Create an Application Pool
Add the Domain Admin User to the workstation group IIS WGL
Ín the aplication pool, set the identity to work as that user.
And that's it, it work on perfection, thank you alot again
Ricardo José Santos
|
|
|
|
|
You're running IIS as a domain admin?! Are you insane?!
Seriously, though: that is a really, really bad idea. You've just given any anonymous user a back door into your entire domain with the keys to every machine in the domain. Not good.
You've somewhat solved the problem though - it's about the permissions of the IIS user. Now you need to either add the normal user that IIS runs as (IUSR_MACHINENAME) to the appropriate groups and / or security rights, or have it run as a non-privileged user with the same constraints.
First, you are trying to use impersonation, but IIS / ASP.NET is throwing an error. Since this is a Win2K3 box, make sure the IIS user has the SeImpersonatePrivilege (configurable in the local machine (or domain, but that's too broad) policy). Next, make sure that the IIS user has permissions to your CDO server (SMTP Services for IIS, or Microsoft Exchange).
The whole idea is to find out what is wrong and make sure that the user that IIS runs under has the appropriate privileges and permissions. If you run as a privileged user you ultimately have all those things but at an extremely great cost!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
It should be report alright but for me it's no problem because the iis is internal, and it's to host a webservice, this is is only to be used from another iis server that its published on the outside, and the calls are made by C# code, the code makes all the changes to AD, exchange, iis, filesystem and etc, it's a provisioning service, there by i need those admin privileges.
The machine it self is secure. so i believe that it's no problem.
I need to authenticate myself in the AD and iis webservice machine.
|
|
|
|
|
I have had the same experience creating users from a kix script.
After creating the user and sets its groups, do a synchronize domain command.
|
|
|
|
|