WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntRunAsUser Discussion in French (primarily)

Keywords: 	  wntRunAsUser wntAddUser


 Topic: 
      Permissions (1 of 65), Read 235 times 
 Conf: 
      WinBatch Script Exchange 
 From: 
      ive ive.gimdal@emw.ericsson.se 
 Date: 
      Tuesday, February 27, 2001 12:07 AM 


Hi

How can I check if permissions is set to allow remote connections or remote performance monitoring by the
user.

Best regards

Ive Gimdal 


Topic: Permissions (2 of 65), Read 108 times Conf: WinBatch Script Exchange From: deanad Date: Tuesday, February 27, 2001 08:20 AM Maybe something like this AddExtender("wproc32i.dll") if WinVersion(4)==4; NT errormode(@OFF) tRemoteConn("\\server") errormode(@CANCEL) if LastError()== 235 Message("Opps","Server not available/ no access") exit endif counterstring="\\server\Memory\Available KBytes" intdat=tGetData(counterstring,0) fltdat=tGetData(counterstring,1) Message("tGetData for %counterstring%",strcat("Float Value: ",fltdat,@CRLF,"Int Value: ",intdat)) else Message("tRemoteConn", "Is designed to only run on NT") exit
Topic: Permissions (3 of 65), Read 77 times Conf: WinBatch Script Exchange From: ive ive.gimdal@emw.ericsson.se Date: Wednesday, March 14, 2001 12:09 AM Hi Marty What kind of Permissions do I need when I use tremoteconnection??? Best regards Ive Gimdal
Topic: Permissions (4 of 65), Read 78 times Conf: WinBatch Script Exchange From: deanad Date: Wednesday, March 14, 2001 07:18 AM When monitoring remote computers, note that the remote computer will only allow access to user accounts that have permission to access it. In order to monitor remote systems from your computer, you must start the Performance Logs and Alerts service using an account that has permission to access the remote computers you want to monitor. By default, the service is started under the local computer's "system" account, which generally has permission only to access services and resources on the local computer. To start this under a different account, use Services under Computer Management and update the properties of the Performance Logs and Alerts.
Topic: Permissions (5 of 65), Read 53 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 11, 2001 01:57 AM hello I'm a french user so excuse me for my bad english. I've a problème with a script : If I want copy files on computer but I have not admin rights so it's impossible. Do you know how can I do to change permission only for the files copy. Thanks Bye
Topic: Permissions (6 of 65), Read 54 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 11, 2001 02:30 AM Si tu n'as pas de droits sur le fichier. Il n'y a pas moyen de changer cela. Il y a moyen de changer temporairement vers un autre utilisateur, mais il faut donner un droit auparavant à l 'utilisateur actuel. Johan
Topic: Permissions (7 of 65), Read 58 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 11, 2001 02:40 AM Je te remercie de m'avoir répondu tout d'abord plus exactement je souhaite pouvoir copier des fichiers sur où la personne qui se log n'as pas de droit d'admin donc elle ne peut copié des fichiers mais je souhaiterai quelle ai des droit le tps de la copie. je sais pas si tu capte ? Si oui as tu une idée parce que franchement je galère ! Merci d'avance bye
Topic: Permissions (8 of 65), Read 62 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 11, 2001 03:20 AM N'y a-t-il pas moyen de simplement lui donner les droits sur ces fichiers en Explorer? Il y un commande en Winbatch qui s'appelle wntRunAsUser. Mais il faut donner beaucoup plus de droits à l'utilisateur qui va en avoir besoin. Si tu fais click avec le bouton droit de la souris sur le fichier ou le 'folder' où se trouve le fichier et tu fais propriétés, puis sécurité, tu peux donner plus de droits à cet utilisateur. TOP | Post | Reply | Reply/Quote | Email Reply | Delete | Edit Previous | Next | Previous Topic | Next Topic | Entire Topic Topic: error with (9 of 65), Read 52 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Tuesday, April 17, 2001 01:33 AM WntRunAsUser When I use it he make me this error : 1452 Reg function What can I do ? Matt
Topic: error with (10 of 65), Read 55 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Tuesday, April 17, 2001 09:47 AM Not sure. But it sounds like a access/security problem. It the error occuring on the wntRunAsUser function or ??? If everything seems to be going well, you have obviously overlooked something.
Topic: RE: Permissions (11 of 65), Read 56 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 11, 2001 07:28 AM -----Message d'origine----- De : scripts Listmanager [mailto:listmanager@webboard.windowware.com] Envoyé : mercredi 11 avril 2001 11:32 Objet : Permissions From: "Johny" Si tu n'as pas de droits sur le fichier. Il n'y a pas moyen de changer =cela. Il y a moyen de changer temporairement vers un autre utilisateur, mais =il faut donner un droit auparavant à l 'utilisateur actuel. Johan To reply: mailto:scripts.39043@webboard.windowware.com To start a new topic: mailto:scripts@webboard.windowware.com To login: http://webboard.windowware.com:8080/~winware en fait je voudrais qu'une session s'ouvre en tps qu'admin le tmps de =la copies ou un script qui permette de changer les droit de l'utilisateur durant une session tu vois ? Mais il faut que cela passe inapercue pour l'utilisateur. TOP | Post | Reply | Reply/Quote | Email Reply | Delete | Edit Previous | Next | Previous Topic | Next Topic | Entire Topic Topic: RE: Permissions (12 of 65), Read 56 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 11, 2001 08:10 AM wntRunAsUser is your friend. Take a look at the TECH DATA BASE to learn more about it. Tu devras utiliser wntRunAsUser à cet effet. Dans le TECH DATA BASE il y a les avantages et désavantages.
Topic: RE: Permissions (13 of 65), Read 53 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 18, 2001 06:10 AM What does it mean : "Act as part of the operating system" It's an nt right ? pour johny si oui au quel correspond t-il en francais thanks
Topic: RE: Permissions (14 of 65), Read 56 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 18, 2001 06:38 AM On 4/18/01 6:10:00 AM, Nox59 wrote: >What does it mean : "Act as >part of the operating system" >It's an nt right ? > >pour johny >si oui au quel correspond t-il >en francais >thanks Yes it's an NT right. I don't have a French version of NT running here. My mother language is Dutch and here at the company all the software is in English. It should be something like: agir comme faisant partie du système d'opération. Or simply: faire partie du système d'opération. In fact it's an advanced user right. Open User Manager Policies/User Rights.../ At the bottom there is a check box saying Show advanced user rights (montrer les droits d'utilisateurs avancés) If you set it, you will find many more options in the drop down list after right: (droit:) I hope this helps, Johny Version francophone C'est un droit d'utilisateur avancé. Peut-être: agir comme faisant partie du système d'opération. Ou plus simple: faire partie du système d'opération. Ouvrir administration utilisateurs Policies/User Rights.../ En bas il y a moyen de sélectionner Montrer droits d'utilisateurs avancés. Une fois mis, tu trouveras beaucoup plus d'options dans la liste suivan droit: N'oublies pas de mettre les autres droits dont tu auras besoin pour WntRunAsUser Johan
Topic: RE: Permissions (15 of 65), Read 49 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 18, 2001 08:24 AM Okay thank you I'm give rights But I'have problème still it's the same errors 637 Privilege 'act as a part ... could you help me please ?
Topic: RE: Permissions (16 of 65), Read 49 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Wednesday, April 18, 2001 09:51 AM The user running the wntAddUser function needs the right, not the user you are trying to "run as". If everything seems to be going well, you have obviously overlooked something.
Topic: RE: Permissions (17 of 65), Read 52 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Wednesday, April 18, 2001 09:52 AM Also, if you give the user the right to usethe wntUserRunAs command, they must log off then log on before the right becomes effective. If everything seems to be going well, you have obviously overlooked something.
Topic: RE: Permissions (18 of 65), Read 39 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Thursday, April 19, 2001 02:30 AM Ok I've add a new user so I give him rights and use it for the wntrunasuser Sorry but I don't Understand pour johny J'ai crée un nouvel utilisateur sur le domaine mais je ne peux lui donnée des droits avec wntprivadd "error adding account right" comment faire pour fermer la session ? excuse moi je suis ennuyeux sorry :-)
Topic: RE: Permissions (19 of 65), Read 40 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Thursday, April 19, 2001 03:08 AM I first wrote the French. Maybe you will notice the English is translated... Don't worry. You have a problem and we will try to resolve it. You have to grant these advanced user rights to the user who is going to run the script in which you are going to use WntRunAsUser. You have to grant them (using the user manager) on the machine where they will be needed. So you don't have to grant them to this user on the server. In fact this implies that you are going to have to do this on all the workstations where you are going to use this script and for all the users who are going to use it. You have to be logged in with administrator rights (maybe it is possible to do it remote with the other user functions) (In fact, having to give users the right to act as part of the operating system, doesn't give me a good feeling. But apparently there is no other way to implement this functionality. I for myself, have decided not to use it). To grant this user right you can write another script. Maybe it is possible to do it remote with a domain admin user. If you only need this functionality once, maybe you can revoke these user rights once again afterwards. I hope this helps Johny Ne t'en fais pas. Tu as un problème et on va le resoudre. Ces droits avancés il faut les donner à l'utilisateur qui va executer le script dans lequel tu as utilisé le WntRunAsUser. Il faut les donner à la machine où le script va être executé. Donc pas sur le serveur. En fait ceci implique qu'ils faut le faire sur toutes les machines et pour tous le utilisateurs qui vont devoir utiliser le script. Il faut être administrateur pour pouvoir donner ces droits. Peut-être il y a moyen de le faire à travers le reseau avec les autres fonctions d'utilisateur. (En fait laisser travailler un utilisateur comme faisant partie du système d'opératio ne me semble pas la situation idéale. Mais apparemment il n'y a pas d'autre moyen pour fair fonctionner cette fonction. Moi j'ai décidé que je ne veux pas l'utiliser). Pour celà tu pourras écrire un autre script. Mais celui-ci, tu devras l'executer comme un utilisateur avec des droits d'admin. Essaye de le faire de distance (Peut-être comme administrateur du domaine). Peut-être il y moyen de fair un autre script pour faire de sorte que les utilisateurs n'ont plus ce droit après que tu aies fini de l'utiliser. Je vais traduire ceci en anglais pour que les gurus puissent me dire si je déconne... Bonne chance et n'hésite pas de demander davantage s'il y a un problème, Johny
Topic: RE: Permissions (20 of 65), Read 42 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Thursday, April 19, 2001 04:20 AM oui en fait c ca que je veux faire stopper les droits après que le script soit fini. dans le script Wntrunasuser je ne peux pas modifier la base registre ce que je voulais faire c'était ajouter un utilisateur (admin) pour que lui execute le script ou que la personne sur l'ordinateur prennent c droit à lui pour l'executer tu comprends ? donc je voulais savoir si je peux faire ca et si oui comment ? Merci encore
Topic: RE: Permissions (21 of 65), Read 42 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Thursday, April 19, 2001 05:48 AM Pour pouvoir ajouter des utilisateurs, il faut que l'utilisateur executant le script soit administrateur. C'est donc une situation poulet/oeuf. Explique un peu ce que tu es en train de faire. Peut-être il y une autre façon d'atteindre le but. Est-ce que la compte d'utilisateur que tu utilises a le droit d'administrateur sur les machines où tu as des utilisateurs qui doivent être capable de lancer un script qui execute le wntRunAsUser? Si c'est le cas, peut-être tu peux ajouter des droits sur leurs machines à leurs comptes d'utilisateurs. Experimentes en peu avec la commande wntPrivAdd( server-name, user/group name, privilege) Comme server name tu peux passer "\\domaine\ordinateur" Et comme user/group name tu peux passer "domaine\utilisateur" Note que la seconde fois il n'y pas deux \\ devant le nom. Pour le nom exacte du privilège il faudra consulter l'aide de ce commande. Ce qui est bon, c'est que c'est possible de le faire à partir de ta machine ou à partir du serveur. Johny
Topic: RE: Permissions (22 of 65), Read 46 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Thursday, April 19, 2001 06:16 AM Le probleme c'est que je me suis rajouter le droits qu'il fallait et meme si je me connecte avec tous les droit il continue de me dire que "act as a part of OS" not held alors que je viens de me les donner Sinon ce que je veux faire : Je souhaite me connecter avec des droit d'aministrateur pour lancer un batch qui va modifier les fichiers systeme ok ? le petit script que tu ma donner ne marche pas. Voilà
Topic: RE: Permissions (23 of 65), Read 48 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Thursday, April 19, 2001 06:43 AM Est-ce que tu as fait un logoff/logon après de te donner les droits? Il faut faire celà avant qu'ils viennent en vigueur. Le petit script n'était pas plus qu'un exemple. Je dois avouer que je n'ai jamais essayé si ça fonctionne, comme je n'aime pas de donner ce droits aux utilisateurs que je ne peux pas faire administrateurs propres. Johny
Topic: RE: Permissions (24 of 65), Read 39 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Thursday, April 19, 2001 07:07 AM Sais tu pourquoi Nt ne me donne pas le droit "act as a part of the os"????
Topic: RE: Permissions (25 of 65), Read 42 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Thursday, April 19, 2001 07:19 AM After giving a user a right or privilege, the user must logoff then locg back on for the right or privilege to become effective. It cannot all be done in one script. If everything seems to be going well, you have obviously overlooked something.
Topic: RE: Permissions (26 of 65), Read 38 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Thursday, April 19, 2001 07:54 AM ok but my problem is that the wntrunasuser do not function because of the right 'act..OS' but I've put this right. Do you understand ? Do you know something to help me. Matt
Topic: RE: Permissions (27 of 65), Read 38 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Thursday, April 19, 2001 09:10 AM You didn't per chance forget about the other two needed rights? N'as tu pas par hasard oublié de mettre les deux autres privilèges dont tu as besoin pour fair fonctionner wntRunAsUser? Johny
Topic: RE: Permissions (28 of 65), Read 37 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Thursday, April 19, 2001 11:18 AM There are two users. 1) The original logged in user. 2) The user that yu want to "Run As". Make sure the original user has the "Act as part of OS": rights on the local machine for his account. If you use User Manager to give the rights, then the user must log off then log on BEFORE the rights are effective. The user that you want to "Run As" does not need any special rights, but it is usually an admin account anyways. If everything seems to be going well, you have obviously overlooked something.
Topic: RE: Permissions (29 of 65), Read 32 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Friday, April 20, 2001 12:30 AM Hello for example : 1) a local user 2) run as "admninistrator" ? ok ? matt
Topic: RE: Permissions (30 of 65), Read 34 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Friday, April 20, 2001 12:34 AM IN fact the user take the admins rights ? but I don't understand because I have try it both AND HE CONTINOUS to say me that the 'act...' not held But the admin normaly have all right ? no
Topic: RE: Permissions (31 of 65), Read 35 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Friday, April 20, 2001 02:01 AM The administrator users don't necessarily have all the rights. Especially not the Advanced user rights. You can easily verify which user rights they retain in user manager. Let's say you have a user Charles and a user Administrator. You need to grant Charles the following advanced user rights: "Act as part of the operating system" "Increase quotas" "Replace a process level token" Once you did this using the User Manager, you log off and log back in. Of course it's all right to reboot your PC entirely as well. You log in as Charles once again and now you can try to execute your script with the wntRunAsUser line in it. Start little do this on 1 workstation without using domain users. If it still fails, post your code. In French: L'administrateur n'a pas nécessairement tous les droits imaginables. Certainement pas tous les droits avancés. De toute façon il y a moyen de vérifier cela dans le 'user manager'. Disons que tu as un utilisateur nommé Charles et un utilisateur nommé Administrateur. C'est à Charles que tu dois donner les droits avancés suivants: "Act as part of the operating system" "Increase quotas" "Replace a process level token" Une fois que tu as donné ces droits, tu dois sortir de cette session et denouver entrer dans le système comme "Charles". Si tu veux tu peux redémarrer ta machine, mais ce ne devrais pas être nécessaire. Maintenant tu peux essayer d'exécuter ton script qui contient la ligne wntRunAsUser. Commence à faire ceci sur une machine, sans utiliser des utilisateurs de domaine, pour commencer. Si ça ne fonctionne toujours pas, montres nous la code et verifie si Charles a bien reçu les droits nécessaires. Ce script te donnera une liste des privilèges retenus par 'Charles'. AddExtender("WWWNT34i.DLL") list=wntPrivList("","Charles") AskItemList("List of privileges for user", list,@Tab,@Sorted,@Single) exit Si la liste est vide, il y a qq chose qui cloche. Johny
Topic: RE: Permissions (32 of 65), Read 35 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Friday, April 20, 2001 02:17 AM Le script que tu ma donné fonctionne correctement mais la liste n'apparait pas moi mon script c'est le configureit.wbt sur le site winbatch que j'essaye de configurer donc moi j'ai les droits que tu m'a dit mais je ne suis pas administrateur je utilisateurs avec droits ok ? Je ne suis pas obliger d'être administrateur ? Merci pour votre aide
Topic: RE: Permissions (33 of 65), Read 39 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Friday, April 20, 2001 02:44 AM On 4/20/01 2:17:00 AM, Nox59 wrote: >Le script que tu ma donné >fonctionne correctement mais >la liste n'apparait pas moi Est-ce que tu as créé un utilisateur avec le nom 'Charles' et est-ce que lui as donné les droits nécessaires? Si non, est-ce que tu as remplacé Charles dans le script par l'utilisateur à qui tu as donné ces droits? Est-ce que la liste est vide? Si oui, est-ce que tu as redemarré ta machine avant de l'exécuter? >mon script c'est le >configureit.wbt >sur le site winbatch que >j'essaye de configurer donc >moi j'ai les droits que tu m'a >dit mais je ne suis pas >administrateur je utilisateurs >avec droits >ok ? Cette dernière phrase je ne comprends pas du tout, je suis désolé. N'oublies pas que je ne suis pas francophone. De toute façon je vais regarder ce script d'un peu plus près. Ce que tu peux toujours faire c'est ajouter la ligne suivante au dessus du script et nous faire parvenir le resultat ("c:\wbdebug.txt") DebugTrace(@on,"c:\wbdebug.txt") Ça nous aidera beacoup à localiser le problème. >Je ne suis pas obliger d'être >administrateur ? Non, l'utilisateur qui va exécuter le wntRunAsUser n'est pas obligé d'être administrateur. Il a seulement besoin de ces 3 droits spécials. >Merci pour votre aide J'espère que ça va fonctionner. Johan
Topic: RE: Permissions (34 of 65), Read 41 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Friday, April 20, 2001 02:55 AM Hi Marty, I have taken a look at this ConfigureIt.wbt script. Maybe it would be a good idea to put some instructions in there that grant the necessary user rights for the RunAsUser.wbt script? I also fail to see the point of the RunAsUser, when one has to relogin to make the RunAsUser work in the first place. And last but not least. When one is executing the ConfigureIt script without administrator rights, he will not be able to write to the registry and the script will fail. But maybe I missed a point somewhere... Johny
Topic: RE: Permissions (35 of 65), Read 40 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Friday, April 20, 2001 05:20 AM ok thanks je fais ce que tu m'a dit et je te l'envoi d'après toi il peut fonctionner le configureit.wbt ?
Topic: RE: Permissions (36 of 65), Read 36 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Friday, April 20, 2001 09:14 AM Oui, il peut fonctionner, mais il ne va s'occuper des droits necessaires. Ça c'est toujours quelque chose que tu devras faire toi-même. Ce qu'il fait c'est écrire dans le registre que la prochaine fois que tu démarres ton ordinateur, il doit tout de suite faire un login avec l'utilisateur designé. Il vaut mieux que tu prends un utilisateur avec des droits d'admin pour cela, parce que sinon tu ne pourras pas reparer ce changement. En plus il faut noter que ton mot de passe est dans le registre en claire vue durant le processus. Ce que je t'avise à faire c'est d'ouvrir ce script en Winbatch Studio et de l'executer une instruction à la fois. En même temps tu lis la description de chaque instruction dans l'aide. Ça, à mon avis, c'est la meilleure façon d'apprendre comment fonctionne Winbatch. Et le bonus c'est que tu apprendras mieux l'anglais. Bon weekend, Johny
Topic: RE: Permissions (37 of 65), Read 34 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Monday, April 23, 2001 01:00 AM Hello I've do your test and my problem it's really with the wntrunasuser function he make me the '637 error' Could you traduce for the green parts because it's possible that I don't understand correctly Thanks
Topic: RE: Permissions (38 of 65), Read 35 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Monday, April 23, 2001 01:25 AM Please post here what you would like to have translated. Johny
Topic: RE: Permissions (39 of 65), Read 23 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Tuesday, April 24, 2001 12:32 AM J'ai l'habitude de répondre dans la langue dans laquelle je suis adressé. Si tu mets ici ce que tu aimerais voir traduit, je m'y mettrai. Johny
Topic: RE: Permissions (40 of 65), Read 20 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Tuesday, April 24, 2001 12:52 AM Regarde aussi Winbatch with Unicenter dans le forum Winbatch. Peut-être le 4ème message est une solution pour ton problème. Johny
Topic: RE: Permissions (41 of 65), Read 37 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Friday, April 20, 2001 10:46 AM Will look at it. The general theory is that once you grant the rights to the users, you jsut leave them like that. Then they can use wntRunAsUserwhen they need to. The security implicationa are unclear, but seem comparable with granting the ability to use the AT command. If everything seems to be going well, you have obviously overlooked something.
Topic: RE: Permissions (42 of 65), Read 36 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Friday, April 20, 2001 03:46 PM I see. Well it remains something I remain reluctant to do. But I'm rather conservative. Of course this has to do with the nature of our users. Most user accounts where I would use this, are accounts for outsiders, people who come to follow a course in our center. As long as I can work around it and not having to grant them these rights, I will. Now about this script. I had expected that it would prepare the user account to work with wntRunAsUser granting the needed rights, but instead it sets the registry to log in as a different user. This is something useful I do use. It's a pity that the password is in the registry in clear text, but I'll just have to live with that. I make sure not to use it once the PCs are out of the installation phase. I don't see the point in doing it this way, when every time there has to be performed a logoff. I had imagined the wntRunAsUser command would enable to switch user context without having to log off and I'm sure it does. This is why I was a bit surprised at seeing this construction with the two scripts. Enjoy your weekend, Johny
Topic: Permissions (43 of 65), Read 47 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Wednesday, April 11, 2001 09:31 AM So you want to know if the user may perform remote monitorng? Hmmm. It is some kind of priviledge, so try teh wntPrivList function or something like that. Also, to do remote monitoring, the remote computer must also be enabled for it. If everything seems to be going well, you have obviously overlooked something.
Topic: Permissions (44 of 65), Read 23 times, 2 File Attachments Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Tuesday, April 24, 2001 01:32 AM Johny Excuse moi hier je travailler beaucoup je te l'envoi donc RUNASUSER2_FR.WBT CONFIGUREIT_FR.WBT
Topic: Permissions (45 of 65), Read 25 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Tuesday, April 24, 2001 03:08 AM ;Script #1 - CONFIGUREIT.WBT - RUN THIS SCRIPT FIRST. IT CONFIGURES ;EVERYTHING AND SETS UP THE REGISTRY TO RUN SCRIPT #2 (RUNASUSER.WBT). ; ;In this script (CONFIGUREIT.WBT): ; ;1. Check username. If currently logged on user is admin, then don't bother writing to the Winlogon ; section. Just run the test script that *does something* using wntRunAsUser and some other admin ; type activity. ; ;2. Otherwise, if not Admin user, write admin user info into the Winlogon part of registry for next ; login session. Then set up the RunOnce key to run the RUNASUSER.WBT script next logon and reboot ; the machine. ; ;~~~~~~~~~~~~~~~~~~~ ;In second script (RUNASUSER.WBT) launched by CONFIGUREIT.WBT: ; ;1. The AutoAdminLogon happens. ; ;2. Do the task that requires admin privileges. ; ;3. Undo the Admin registry stuff since the current user is not the administrator, set AutoLogon to 0, ; and reboot. ; Script No. 1 - CONFIGUREIT.WBT - D'abord exécutez ce script-ci. Il va tout configurer ; et modifier le registre pour exécuter le Script No. 2 (RUNASUSER.WBT). AddExtender("WWWNT32I.DLL") curuser=wntGetUser(@default) ;Message("Current User is", curuser) reguser=RegQueryValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]") if strlower(curuser)==strlower("Administrateur") ;or customize as necessary to someone with admin privileges ; ici vous pouvez customiser comme vous voulez. Ça peut donc également être un utilisateur different avec des droits d'admin ;You're an Admin, go ahead and do a RunAsUser without additional settings required ; Maintenant vous êtes administrateur. Profitez-en pour faire un RunAsUser sans qu'il y ait besoin que cet utilisateur ait davantage de droits. Group = "Administrateur" User = reguser Pass = "xxx" Domain = "OPC" PDC = "\\siege-opc" thegroups=wntMemberLst2(PDC,Group,@LOCALGROUP) thegroups=strreplace(thegroups,@tab,@crlf) Message("List of Members Before Change", thegroups) wntRunAsUser(Domain, User, Pass, 2, 0) curuser=wntGetUser(@default) ;Message("Current User is", curuser) ;Now do the Admin task ; Maintenant faites quelque chose pourquoi il vous fallait le droit d'admin. ans = AskLine("Add User", "What is the name of a valid domain\user you want to add to %Group%?", "") rslt = wntMemberSet(PDC, Group, ans, @LOCALGROUP) thegroups=wntMemberLst2(PDC,Group,@LOCALGROUP) thegroups=strreplace(thegroups,@tab,@crlf) Message("List of Members After Change", thegroups) Message("All", "Done") exit else ;currently logged on user is NOT admin user ; ça a echoué parce que l'utilisateur qui a fait le login n'a pas de droits administrateur. desktop=ShortCutDir("Desktop") domainname="OPC" username="administrateur" ;or someone with admin privileges ; ou un autre utilisateur avec des privilèges admin. password="Yahoo" ;change the necessary settings for Adminautologon at next logon ; modifier le registre pour que le 'username' va faire un login automatique la prochaine fois. RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultDomainName]",domainname) RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]",username) RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultPassword]",password) RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[AutoAdminLogon]","1") ;First add the Winbatch script that'll do the autoadminlogon into the RunOnce key ; D'abord modifiez le registre pour que notre 2ème script va démarrer automatiquement RegSetValue(@REGMACHINE, "Software\Microsoft\Windows\CurrentVersion\RunOnce[wbfile]", "c:\temp\runasuser.exe") ;Message("Before", "IntControl") ;now do the logout. The machine will logout out current user, autologonadmin, and run the RUNASUSER.EXE script. ; maintenant on va sortir de Windows, tout a été préparé pour que un autologonadmin soit effectué et RunAsUser.exe soit exécuté IntControl(66,0,0,0,0) endif ****************************************************************************************** IntControl(12,8,0,0,0) AddExtender("WWWNT34I.DLL") ;Now you should have administrator rights... do a RunAsUser then set Winlogon settings back to NULL ; Maintenant il faudrait que vous ayez des droits d'admin... Effectuez un RunAsUser, puis reinitiez les settings ; dans le registry en dessous de Winlogon. Group = "Utilisateurs" User = RegQueryValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]") User = "test" Pass = "xxx" Domain = "opc" PDC = "\\siege-opc" thegroups=wntMemberLst2(PDC,Group,@LOCALGROUP) thegroups=strreplace(thegroups,@tab,@crlf) Message("List of Members Before Change", thegroups) ans = AskLine("Add User", "What is the domain\user you want to add", "") ;Make sure you've got the setting "Act as part of the operating system" ;set under User Manager/Policy menu (for the particular user who's logging in with Admin rights). ;Also note that after you make the above change, you have to logout and relogin for the setting ;to take effect. ; Faites de sorte d'avoir le droit "Act as part of the operating system" ; dans l'administration des utilisateurs/Menu Policy. (Pour l'utilisateur qui veut adopter des droits d'admin) ; Il faut aussi noter que après d'avoir effectué ce changement, il faut sortir de Windows pour que ces droits prennet effet. wntRunAsUser(Domain, User, Pass, 3, 0) Errormode(@off) ;now add the new user to the group rslt = wntMemberSet(PDC, Group, ans, @LOCALGROUP) Errormode(@cancel) err=LastError() if err==562 Display(1,"Warning", "Your Username was not Valid") goto setreg else if err Display(1, "Warning", "An error has occurred.") goto setreg endif endif ;now list out all the new users ; ici on va faire une liste de tous les utilisateurs nouveaux. thegroups=wntMemberLst2(PDC,Group,@LOCALGROUP) thegroups=strreplace(thegroups,@tab,@crlf) Message("List of Members After Change", thegroups) Message("All Done", "You've accomplished your chore. Now get ready to relogon...") ;we fall through to here immediately if we get an error on the MemberSet function. ; on va venir jusqu'ici tout de suite s'il y une erreur avec la fonction MemberSet :setreg ;Now change autoadminlogon settings back to NULL ; Ici on va remettre les changements au registre du script préalable RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultDomainName]","[]") RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]","administrateur") RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultPassword]","[]") RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[AutoAdminLogon]","[0]") ;now logout as current admin user ; et on sort de Windows comme utilisateur admin. IntControl(66,0,0,0,0)
Topic: Permissions (46 of 65), Read 28 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Tuesday, April 24, 2001 03:19 AM I forgot something: ; Script No. 1 - CONFIGUREIT.WBT - D'abord exécutez ce script-ci. Il va tout configurer ; et modifier le registre pour exécuter le Script No. 2 (RUNASUSER.WBT). ; Dans ce script (CONFIGUREIT.WBT): ;1. Vérifier username. Si l'utilisateur qui a fait le logon actuel est admin, il ne faut même pas faire un relogin ; On peut simplement utiliser l'autre scripts qui *fait qq chose* utilisant using wntRunAsUser qui exécute une autre ; activité typique admin. ; ;2. Dans l'autre cas, où l'utilisateur n'est pas Admin, on va écrire l'info utilisateur admin dans la partie Winlogon du registre for next ; pour preparer la session suivante. Puis on prépare la clez RunOnce pour exécuter notre script RUNASUSER.WBT et on redémarre ; la machine. ; ;~~~~~~~~~~~~~~~~~~~ ;Dans le second script (RUNASUSER.WBT) lancé par CONFIGUREIT.WBT: ; ;1. On entre par moyen d'AutoAdminLogon. Donc il n'y a même pas d'intervention d'utilisateur. ; ;2. On exécute la tâche pour laquelle il nous fallait les privilèges admin. ; ;3. On va reparer nos changements dan le registre, puisque l'utilisateur original n'est pas administrateur, ; et on redemarre le PC
Topic: Permissions (47 of 65), Read 27 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Tuesday, April 24, 2001 04:48 AM Je te remercie Johny de passé autant de tmps avec moi pour ce problème thanks you matt I try now
Topic: Permissions (48 of 65), Read 27 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Tuesday, April 24, 2001 07:12 AM I don't understand I've all right that I must have and it's no good !
Topic: Permissions (49 of 65), Read 25 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Tuesday, April 24, 2001 07:59 AM Est-ce que tu as déjà mis DebugTrace au dessus de ces scripts? Essaye un peu cela et passes nous les fichiers produits. En outre il pourrait s'avérer informatif d'ajouter un privileges=wntPrivList( server-name, user/group name) De cette façon on aura un peu plus de données pour resoudre ce problème. Il va de soi que tu devras remplacer server-name et user/group name par ton utilisateur qui va invoquer le 1er script. Johny
Topic: Permissions (50 of 65), Read 27 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Tuesday, April 24, 2001 08:12 AM Comment dois-je faire debug (@on) en haut du script c'est ca ?
Topic: Permissions (51 of 65), Read 19 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 12:10 AM non, plutôt DebugTrace(@on,"c:\wbdebug.txt"), mais celà tu aurais trouvé plus vite dans le manuel qu'ici. Johny
Topic: Permissions (52 of 65), Read 16 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 25, 2001 12:24 AM I can't set value to reg I suppose that it's because he not found my rights 'act as a part of OS' No ?
Topic: Permissions (53 of 65), Read 20 times, 1 File Attachment Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 25, 2001 01:05 AM C'est une version de Winbatch téléchargé sur winbatch.com je n'ai donc pas de manuel sinon je t'envoi le fichier WBDEBUG(1).TXT (2KB)
Topic: Permissions (54 of 65), Read 23 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 01:42 AM Quand tu poses ton curseur sur une commande et tu fais Shift-F1 tu vas voir un monton d'aide. Ça fonctionne aussi si tu fais bouton droit en dessus d'une commande, puis keyword lookup. Johny
Topic: Permissions (55 of 65), Read 18 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 25, 2001 02:08 AM que pense tu du fichier debug.txt
Topic: Permissions (56 of 65), Read 22 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 02:38 AM Matt, Il me parait normal que ça ne fonctionne pas. Tu ne peux pas écrire des données dans le registre si tu n'as pas des droits d'admin. Il y a donc qq chose avec la logique de ce script qui ne va pas. Marty, This script is going to try and do an AutoAdminLogon when the current user is not an administrator, but when this user is not an administrator, it will be impossible for him to write to this particular part of the registry. Kind of a chicken and egg situation. I'll try and come up with a different kind of example script for the wntRunAsUser function. Johny
Topic: Permissions (57 of 65), Read 25 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 25, 2001 02:54 AM Ok je n'ai pas bien compris ton mail avant mais je pense aussi que c'est bizzare(it's strange). Je pensait que l'un des 3 droits permettait d'écrire dans le registre.
Topic: Permissions (58 of 65), Read 20 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 05:01 AM Oui, mais à ce moment-là où tu vois l'erreur, le wntRunAsUser n'a pas encore été invoqué. Je suis en train de faire un autre exemple, mais je dois encore un peu le tester. Johny
Topic: Permissions (59 of 65), Read 21 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 25, 2001 05:13 AM OK je te remercie je fais moi aussi des tests je te dis quoi
Topic: Permissions (60 of 65), Read 29 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 05:40 AM Bon quelques points à noter: - Avant d'exécuter le premier script, prepare ton PC pour faire un logoff. Ferme toutes les autres applications et sauve les fichiers ouverts. - Le mieux c'est d'exécuter le script pas à pas pour comprendre comment il fonctionne. - Quand le logoff s'est effectué, rentre denouveau avec 'newuser' 'xxx' sur ton PC local. Surtout pas sur le domaine. - Ouvre le second script dans Winbatch Studio et remplace YourAdminPasswordGoesHere par ton mot de passe de l'administrateur local. - Il est normal que la première fois quand tu vas faire fonctionner ce script, il va échouer. C'est pour démontrer que la commande pour modifier le registre ne fonctionne pas dans ce contexte utilisateur. - Mets une ';' devant ce commande et essaye denouveau. Ça dure un petit peu pour vérifier ton mot de passe, mais si tu passes le wntRunAsUser, la commande suivante sera, cette fois, si exécuté. - Voilà, maintenant tu as vu comment fonctionne cette commande. Il faut noter que tu dois connaître le mot de passe de ton administrateur, sinon ça ne fonctionnera jamais. Bonne chance, Johny SetUpUser.wbt ------------- ; This script is preparing a common user to be able to use the wntRunAsUser function. ; It has to be run as an administrator. ; Ce script preparera un utilisateur normal pour le rendre capable d'exécuter la fontion wntRunAsUser ; Il faut l'exécuter en tant qu'adminstrateur. AddExtender("WWWNT34i.DLL") ; Create a new user on the local machine for our little demo ; Pour la démonstration on va créer un nouvel utilisateur sur la machine locale wntUserAddDat("name", "newuser") wntUserAddDat("password", "xxx") wntUserAddDat("flags", 1) wntUserAddDat("acct_expires", "0000:00:00:00:00:00") wntUserAdd("") ; Let's give it the necessary privileges ; On va le donner les privilèges nécessaires wntPrivAdd("","newuser","SeTcbPrivilege") wntPrivAdd("","newuser","SeIncreaseQuotaPrivilege") wntPrivAdd("","newuser","SeAssignPrimaryTokenPrivilege") ; We need to relogon as this newuser ; On sort de Windows, pour recommencer comme ce newuser Message("Warning",StrCat("This script will log you out of this session",@crlf,"Please relogin as 'newuser'",@crlf,"on the local computer",@crlf,"using the password: 'xxx'")) IntControl (66, 0, 0, 0, 0) Exit TestwntRunAsUser.wbt -------------------- AddExtender("WWWNT34i.DLL") ; Let's first test if you are properly following this demo ; D'abord on va vérifier si vous avez bien suivi les instructions du script préalable: curuser=wntGetUser(@default) If curuser!="newuser" then Message("Warning",StrCat("This script is part of a tandem",@CRLF,"It is supposed to show how wntRunAsUser works",@CRLF,"You will need to run SetUpUser.wbt first though",@CRLF,"and then login with the 'newuser' account created in there")) Endif ; Let's try to a typical admin thing like writing to the registry ; You will notice that it doesn't work ; Maintenant on van essayer qq chose typiquement possible comme administrateur ; écrire dans le registre ; Vous noterez que ça ne fonctionnera pas RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]","testing") ; So you will have to comment it out so the rest of the script can get executed and run it again ; Il faudra donc le mettre en commentaire pourqu'il continue avec le reste la prochaine fois que le script est exécuté. wntRunAsUser( "", "administrator", "YourAdminPasswordGoesHere", 2, 0) ; Here you can put what you needed to run as a different user ; Ici vous mettez ce que vous vouliez exécuter comme un autre utilisateur RegSetValue(@REGMACHINE,"Software\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]","testing") Exit
Topic: Permissions (61 of 65), Read 19 times Conf: WinBatch Script Exchange From: Nox59 matthieu.devos@opc.fr Date: Wednesday, April 25, 2001 09:00 AM cool I thank you johny I have take a little part of your script and It' GOOD Your are the Best thanks you man
Topic: Permissions (62 of 65), Read 3 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 01:38 PM What is more important: Did you find out how to invoke help from within Winbatch Studio? Plus important: as-tu trouvé comment invoquer l'aide pour les commandes dans le Winbatch Studio? Johny
Topic: Permissions (63 of 65), Read 9 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Wednesday, April 25, 2001 09:05 AM And thank you for hanging in there also... If everything seems to be going well, you have obviously overlooked something.
Topic: Permissions (64 of 65), Read 5 times Conf: WinBatch Script Exchange From: johny rainbow@linuxfan.com Date: Wednesday, April 25, 2001 12:55 PM You are both welcome. Even when at times I was starting to believe this was going to become the never ending thread :^) I guess you can use my little example to illustrate wntRunAsUser? Maybe alongside the other example? Or does it need more comments for that? Johny
Topic: Permissions (65 of 65), Read 3 times Conf: WinBatch Script Exchange From: Marty marty@winbatch.com Date: Wednesday, April 25, 2001 01:53 PM I'll let the documentation people know about the thread. Maybe we'll also post the entire French thread... If everything seems to be going well, you have obviously overlooked something.

Article ID:   W14890
File Created: 2017:08:29:11:51:04
Last Updated: 2017:08:29:11:51:04