Script for request a certificate using other user's credentials

Hi, 
I need to request for a certificate using other test user's credential. For this requirement I came up with the following script, 
cd C:\temp-folder
Add-Content C:\temp-folder\req.inf "[NewRequest]`r`nSubject=`"CN=Test01`"`r`nRequestType=pkcs10`r`n`r`n[RequestAttributes]`r`nCertificateTemplate=TestUser" #This line would create the inf file
$username = 'MyDomain\Test01'
$password = 'Pass1234'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
Invoke-Command -Credential $cred -ComputerName localhost -scriptblock {
certreq -new req.inf certnew.req
certreq -submit -config "ca.mydomain.com\MyEnterpriceCA" certnew.req certnew.cer
certreq -accept certnew.cer
But when it comes to executing the certreq command, the script hangs. Is there a possible way to come around this issue and request a certificate under MyDomain\Test01 user account via a script ? 
Thank you...

Hi,
In MMC you can add Certificates and in personal certificate Advance option you can use ON BEHALF OF users.
Regards,
Yan Li
Cataleya Li
TechNet Community Support

Similar Messages

  • Scripts for changing the address of the user when they have been in the box for 6 months

    Scripts for changing the address of the user when they have been in the box for 6 months
    If users are in a folder for deactivated users and disabled users in Active Directory, and been there for 6 moths do: change email address in exchange to existing email address.old 
    Anyone have suggestions on how I can go about it?

    What is this "box"?  What is this "folder" you're asking about?  You'll likely get a better answer if you use standard terminology.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • If I connect a time capsule via ethernet to an existing internet connection and use it to create a private wifi network for my wireless devices, will other users on the primary network (not the private wifi one) be able to access my files on my TCapsule?

    Like it says in the title basically.
    I want to use a time capsule to store my files and backups and access it from my phone and MacBook Air. However I do not want the others in my house who are currently connected to the same wifi/ethernet router to use my connection or my TC hard drives.
    I had also been thinking about wirelessly extending the wifi network (a linksys N router) but I guess that will allow everyone to access my Time Capsule?
    I hope you guys can help me.
    Regards, Guido

    ......will other users on the primary network (not the private wifi one) be able to access my files on my TCapsule?
    No, if you have not provided them with the Time Capsule device password. 
    Users will be able to "see" the Time Capsule icon under the SHARED heading in the Finder on their Macs, but they will not be able to access the drive or the files.
    I had also been thinking about wirelessly extending the wifi network (a linksys N router) but I guess that will allow everyone to access my Time Capsule?
    Same answer as above.

  • Login Script for HP Thin Clients using Citrix

    Hi
    Could someone please assist me with this.
    I use a login script on my domain but I am now joining the HP Thin Clients onto the domain which will use SSON (Single Sign ON) which will automatically load citrix and use the current username and password to sign into the citrix session
    Is there a command I can use that will "check" the version of windows and if this is Windows 7 embedded Standard edition, then it will bypass all the commands and go to the end of the script.
    I was trying something like this IF "%OS Version%" == "Microsoft Windows 7 Embedded Standard" goto END
    I know you can use this for a "Computer Name" but we have so many terminals and would need to store all the names of them on the servers.
    Please can someone give me some advise on this.
    Thanks
    Martin

    Hi,
    As far as I know, you can user command systeminfo | findstr /B /C:"OS Name" /C:"OS Version"to check current system edition in
    Command Prompt. However, as I'm not fimilar with script, to need more assistance for your problem, it would be better to provide your question at script center.
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?category=scripting
    Roger Lu
    TechNet Community Support

  • Script for quitting an application when switching users?

    Is there any way to create an applescript that will quit iTunes for me when I switch users?
    I have my computer set up with two users, one for work and one for "play". I use iTunes in both users and they both use the same library. Because of this, iTunes cannot be open and functioning on both users at the same time. Since I regularly switch between the two (perhaps more than I should), I need to quit iTunes to use it in the other user. However, I often forget and have to switch back to the previous user in order to quit the program... which is pretty annoying.

    Hm, you can trigger script's on login & logout, but it does not seem to be possible to do this on a fast-user-switch....
    So trigger the fast-user-switch itself and quit iTunes within this process:
    tell application "iTunes" to quit
    do shell script "'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspend"

  • Required to create a script for base table update using XMLSTORE package.

    Hi can anybody provide me some help full suggestion on how to update base table using XMLSTORE package.
    I created a simple script for Employee table and can able to do the basic operation like Insert and update on the table.
    Query is as follow's
    DECLARE
    insCtx DBMS_XMLSTORE.ctxType;
    rows NUMBER;
    xmlDoc CLOB :=
    '<ROWSET>
    <ROW num="1">
    <EMPLOYEE_ID>922</EMPLOYEE_ID>
    <SALARY>1801</SALARY>
    <HIRE_DATE>17-DEC-2007</HIRE_DATE>
    <JOB_ID>ST_CLERK</JOB_ID>
    <EMAIL>RAUSSJACK</EMAIL>
    <LAST_NAME>JACK</LAST_NAME>
    <DEPARTMENT_ID>20</DEPARTMENT_ID>
    </ROW>
    <ROW>
    <EMPLOYEE_ID>923</EMPLOYEE_ID>
    <SALARY>2001</SALARY>
    <HIRE_DATE>31-DEC-2005</HIRE_DATE>
    <JOB_ID>ST_CLERK</JOB_ID>
    <EMAIL>PATHAK</EMAIL>
    <LAST_NAME>PRATIK</LAST_NAME>
    <DEPARTMENT_ID>20</DEPARTMENT_ID>
    </ROW>
    </ROWSET>';
    BEGIN
    insCtx := DBMS_XMLSTORE.newContext('EMPLOYEES'); -- Get saved context
    DBMS_XMLSTORE.clearUpdateColumnList(insCtx); -- Clear the update settings
    -- Set the columns to be updated as a list of values
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'EMPLOYEE_ID');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'SALARY');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'HIRE_DATE');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'JOB_ID');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'EMAIL');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'LAST_NAME');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'DEPARTMENT_ID');
    -- Insert the doc.
    rows := DBMS_XMLSTORE.insertXML(insCtx, xmlDoc);
    --COMMIT;
    DBMS_OUTPUT.put_line(rows || ' rows inserted.');
    -- Close the context
    DBMS_XMLSTORE.closeContext(insCtx);
    END;
    SELECT employee_id, LAST_name FROM employees WHERE employee_id = 114;
    DECLARE
    updCtx DBMS_XMLSTORE.ctxType;
    rows NUMBER;
    xmlDoc CLOB :=
    '<ROWSET>
    <ROW>
    <EMPLOYEE_ID>114</EMPLOYEE_ID>
    <LAST_NAME>PRABHU</LAST_NAME>
    </ROW>
    </ROWSET>';
    BEGIN
    updCtx := DBMS_XMLSTORE.newContext('EMPLOYEES'); -- get the context
    DBMS_XMLSTORE.clearUpdateColumnList(updCtx); -- clear update settings
    -- Specify that column employee_id is a "key" to identify the row to update.
    DBMS_XMLSTORE.setKeyColumn(updCtx, 'EMPLOYEE_ID');
    rows := DBMS_XMLSTORE.updateXML(updCtx, xmlDoc); -- update the table
    DBMS_XMLSTORE.closeContext(updCtx); -- close the context
    commit;
    END;
    Nowi want little modification on this above query like as i am passing static XML tags and i want it to pick the dynamic XML from web and use the XMLSTORE for the update.
    and also for complex XML having 2-3 levels how this query needs to be changed.As i am new to this Oracle utillity any help from xepert will be a great help for me.
    Thanks

    Nowi want little modification on this above query like as i am passing static XML tags and i want it to pick the dynamic XML from webFrom a Web Service?
    You'll need UTL_HTTP or HttpUriType interface to send the request and receive the XML response.
    Search in the forum, there are already a lot of useful examples available.
    and also for complex XML having 2-3 levels how this query needs to be changed.DBMS_XMLStore is OK for readily processing a canonical XML format (/ROWSET/ROW/COLUMN structure or alike).
    However, if you have to deal with a more complex structure, you either have to :
    - use a target object table that matches the XML structure
    - preprocess the input document using XSLT to transform it to canonical format
    That's why DBMS_XMLStore is not appropriate for multilevel documents, especially if they contain nested repeating groups.
    In this case, XMLTable is a more flexible way of parsing the XML and process it relationally at the same time.
    Depending on the size of the document, performance may be improved with schema-based object-relational storage.
    For more help, please post a new thread in the {forum:id=34} forum, with the following information :
    - database version (select * from v$version)
    - a sample XML document (the complex one)
    - DDL of your target table
    - mapping between XML elements and columns (ie which tag goes to which column?)
    - an XML schema (if you have one)

  • How to create Transaction code for ABAP and execution by other user

    Hi All,
    Could someone please let me know how to create transaction code in detail for ABAP program. Step by step procedure expected. I would like to know how other user can execute the report using same transaction code which I have created.
    More about authorization.
    Thanks in advance.

    Hello,
    You can create transaction code from se80 as well.In object navigator,right click on your program name and create->transaction code.You can create transaction and select if it is only a report,a report with selection-screen depending on your requirement.You can run your report directly by entering the transaction code in the command field.
    You can authorise the users who can use your transaction:
    <b>Authorisation objects</b> are used to restrict certain transactions to users.Critical data must be protected from unauthorised users.For example,the head has access to certain data.But it cannot be accessed by his subordinate.For this we need to define <b>roles</b>.
    •Create an authorization object with transaction SU21.
    An object usually consists of the ACTVT (activity) field and one other field,which specifies the data type to be protected.By ACTVT, we can decide if the data is accessible for change,display only etc.
    •Add authorization fields to the authorization object created.
    •Assign the authorization object to the transaction using SE93.
    Attach the authorization object to the role using transaction PFCG.
    If you want <b>to assign roles</b>,use transaction PFCG.Create a new role.In the AUTHORIZATIONS tab,you can get a self generated profile name and a profile text by clicking on the icon next to it.Then go to the "Change Authorization data" and choose an authorization template.Then you can choose to display/change/create an activity and after the selection,click on the red and white circle.The profile will now be created.
    In the user tab,you can give the user details who can use this role.
    <b>Also check this link:</b>
    http://www.*********************/r3_security/r3_security_tips.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/52/6716a6439b11d1896f0000e8322d00/content.htm
    <b>Very helpful guide:</b>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
    Regards,
    Beejal
    **Reward if answer is helpful

  • Build script for CXF web service using ant.

    Hi, I am trying to build a CXF web service using ant. Does any one have a sample build script for it or steps (such as 1. build wsdl using java2wsdl task, 2. create a war etc.....) to follow to successfully build a web service using Apache CXF and ANT? Your help is greatly appreciated. I am using tomcat server and spring.
    Thanks

    Hi,
    You can find and download sample of project and build scripts from
    'Design and implement POJO Web services using Spring and Apache CXF, Part 1: Introduction to Web services creation using CXF and Spring':
    http://www.ibm.com/developerworks/library/ws-pojo-springcxf/

  • Connect Coldfusion 9 to SQL using intranet users windows credentials

    Is it possible to use pass through / integrated authentication using the application users windows account (rather than the service account) when a Coldfusion application connects to an MS SQL DB?
    For background, we are running:
    ColdFusion 9,0,1,274733 hosted on a Windows 2008 R2 (64) server
    SQL server 2008 R2 hosted on a Windows 2008 R2 (64) server
    IE 8 and/or 9 as the client browser
    I have an intranet application that is used only by users within our AD domain. I have no problem getting ColdFusion to connect to the SQL database using the ColdFusion service account, but ideally we would like the connection to be made under the application user's account.
    I would appreciate any guidance on how to achieve this if it is possible?
    (I am not a webmanager/developer and so my ColdFusion knowledge is very limited!)
    Thanks in advance,
    Darren

    Again, thanks for the responses - it is nice to be able to talk through these things (I work in a fairly small organisation and so do not often get to talk through technical subjects with other professionals!)
    Firstly, to respond to BKBK, I have been considering that approach, though unless I have missed something, I would either:
    1. have to use simple authentication - in which case a users windows credentials would be passed as Binary_Base64 (i.e. clear text) - and possibly would need to replicate all AD accounts as SQL server accounts (not sure in that account replication bit as I may be able to still get it to authenticate as a windows account from the SQL engine - but the clear text passwords is the real problem), or:
    2. have to use form based credentials, in which case the users would have to 'login' to the application - I am trying to avoid this to make it as seamless for the users as possible.
    Neither of those approaches are ideal (unless, as I say, I am missing an option there) and so I am more inclined to use a single SQL account from the datasource definition and control access from a combination of the application and the database.
    Secondly, to respond to Dan.
    I agree, it would be no good for User A to receive an error if they tried to run a proc that they do not have permissions for. However, if these errors occur they are captured and handled gracefully in both the application suite and the database.
    Aside from this, the application does not provide the ability for user A to execute procedure 7 (from the example in my previous post) - which I guess is what you are saying with " Whatever UI control User B has to run sp 7 cannot be available to User A".
    The reason for controlling physical permissions in the DB was that:
    1. it is universal for all interfaces with that database - so long as integrated auth is used
    2. it provides a belt and braces approach (as parts of this application has sensitive data) - so that if somehow user A gets the web application to call procedure 7 then the DB would still prevent it
    For thought/discussion:
    I think I will end up using a single account from the datasource, but make it a datasource that can only be called from AD users accessing the application (though only AD users can access the application which achieves this already).
    Any call to the database must include the CGI variable "AUTH_USER" as an input parameter.
    The DB will then:
    1. check the account that is logged in to the SQL engine (to ensure a user hasnt bypassed coldFusion and gone straight to the DB - though Group permissions are already set for this scenario)
    2. Check the user supplied as a parameter exists in AD and is an active account
    3. and check the permissions of that user for the particular task that was requested of the DB engine. - execute if permissable, gracefully refuse with appropriate messages passed back if not.
    This combined with the control in the application to only present the right functions to the right user should give me the belt and braces that we are after - all be it in a bit of a convoluted way!
    I guess the big question is how easy/difficult is it to fake "AUTH_USER"?

  • Problems trusting certificates from other users

    I'm unable to trust certificates from users when the email address on their certificate does not precisely match the From address of the message. The mismatch is typically something like a From address of [email protected] and a certificate address of doe.john.12345.
    Mail says "Unable to verify message signature" when I select the message. I click "Show Details" followed by "Show Certificate". I then get an option to check "Messages from xxx are valid if signed by yyy", which I do followed by clicking "OK".
    The yellow "Unable verify message signature" bar stays in place. Repeating the above process shows that the the option to trust the validity is again unchecked. However, in the area with certificate, it lists that the certificate is trusted for the email address in the From field.
    Any idea what's going on here?
    Thanks,
    Andreas

    I should add that this happens when using certs that were signed with a CAC. I have an ORC ECA cert.
    —Andreas

  • Creating a script for a PRIMARY KEY USING INDEX SORT doesn't work

    Probably a bug.
    h1. Environment
    Application: Oracle SQL Developer Data Modeler
    Version: 3.0.0.655
    h1. Test Case:
    1. Create a new table TRANSACTIONS with some columns.
    2. Mark one of numeric columns as the primary key - PK_TRANSACTIONS.
    3. Go to Physical Models and create new Oracle Database 11g.
    4. Go to Physical Models -> Oracle Database 11g -> Tables -> TRANSACTIONS -> Primary Keys -> PK_TRANSACTIONS -> Properties:
    a) on General tab set Using Index to BY INDEX NAME
    b) on Using Index tab choose a tablespace
    c) on Using Index tab set Index Sort to SORTED.
    5. Export the schema to DDL script. For the primary key you will get something like this:
    ALTER TABLE TRANSACTION
    ADD CONSTRAINT PK_TRANSACTION PRIMARY KEY ( TRAN_ID ) DEFERRABLE
    USING INDEX
    PCTFREE 10
    MAXTRANS 255
    TABLESPACE TBSPC_INDX
    LOGGING
    STORAGE (
    INITIAL 65536
    NEXT 1048576
    PCTINCREASE 0
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
    ) SORTED
    h1. Reason of failure
    The script will fail because SORTED is not allowed here. It should be SORT.
    Additionally, the default behaviour for Data Modeler is to set Index Sort to NO but default setting for Oracle database 11g is SORT. Shouldn't Data Modeler use SORT as the default value?
    Edited by: user7420841 on 2011-05-07 03:15

    Hi,
    Thanks for reporting this problem. As you say, it should be SORT rather than SORTED. I have logged a bug on this.
    I also agree that, for consistency with the database default, it would be better to have SORT as the default in Data Modeler.
    David

  • Script for Button 3 or using side buttons on Mighty Mouse for Button 3

    Looks like the preferences for Mighty Mouse only allow the side "squeeze" buttons to be used for Button 4. I don't want to use the scroll ball for Button 3 because it keeps zooming when i do. Does anyone know how to write a script to configure the side buttons to be Button 3?

    I think I'm having a similar problem. Lately, my side buttons have been activating seemingly on their own. I hear multiple clicking sounds. I know I can turn off the button, but I use USB Overdrive to activate page back in browsers and the Finder, so I can be surfing and be brought back several pages at once. Very irritating. It doesn't seem to be consistent either. I bought my latest iMac in June, so I the warranty should be in place, but I'm an hour and half from the nearest Apple store, making it somewhat inconvenient to have the mouse looked at.
    Heh, right when I was about to post this message, it went back several pages.

  • ITunes will launch for specific admin but no other user (including root).

    Mac OS X 10.6.3, iTunes 9.1.1
    I have re-installed iTunes using a different admin user and even as root and the problem persists. I have repaired permissions with root as well (after trying with 2 admin users). Permissions show as being repaired.
    I have never seen an issue on any *nix system where an app won't launch for root but will launch for a user.
    Any ideas on how to fix it or anyone know how to completely uninstall iTunes from the system to try again from scratch?

    The application starts to launch in the Dock but never finishes and I've looked all over Console's logs to try and find an error message but there isn't one. It does not bring up the "Unexpectedly Quit" dialog, either.
    If you are familiar with how apps crash on the iPhone, where they just immediately exit back to SpringBoard, it is like that.
    The strange thing is, my main account which is an administrator, does not have any problems launching iTunes. I only discovered this problem because I can't use the File Sharing feature of any of my iPad apps so I was using a different test login (also an admin) to troubleshoot. Then I thought maybe there was a permissions error I couldn't find so I logged in with root and the problem persisted there, too. I am thinking if I fix this error I will be able to use File Sharing (which works on the same iPad with my VAIO and Win7).
    I would just re-install Mac OS X but my optical drive doesn't work any more.

  • Synonym for Sequence e grant to other user

    Hola,
    I have two user
    AAA e BBB
    In AAA I have this sequence SQ_NUMEAVVI
    I create in BBB user
    CREATE SYNONYM SQ_NUMEAVVI_AAA FOR AAAA.SQ_NUMEAVVIAnd from sql connection of user BBB I haven't problem to see this sequence, but when I compile this function
    CREATE OR REPLACE  FUNCTION F_CALCNUMEAVVISEQU (VC_USER IN VARCHAR2)
    RETURN varchar2 IS
         VC_NUMEAVVI             VARCHAR2(15);
    BEGIN
         SELECT      DECODE((SELECT CODI_TIPO_UTEN FROM ANAGUTEN WHERE NOME_UTEN = upper(ltrim(rtrim(VC_USER)))),10,'C',11,'R',12,'S',13,'D','C')||SQ_NUMEAVVI_AAA.NEXTVAL
         INTO      VC_NUMEAVVI
               FROM      DUAL;
    RETURN(VC_NUMEAVVI);
    EXCEPTION
         WHEN OTHERS THEN
         RETURN(1);
    END;
    /I have the error "The sequence doesn't exist"
    Do you have to give a grant to this sequence from AAA to BBB?
    And How can do?
    Thank's!!
    Paolo

    GRANT SELECT ON SQ_NUMEAVVI TO BBB;SY.

  • FYI: My script for a consistent export using Flashback_time

    This is my first 'non-question' post, but thought it might be useful to others, as I spent a bit of trial & error getting it to work:
    Here is the OS command, to create an export as per a Flashback_time:
    SET exportDate=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2% %TIME:~0,2%%TIME:~3,2%00
    echo %exportDate%
    20100222 092500
    expdp '"/ as sysdba"' job_name=mySID dumpfile=dpdump_dir:mySID_FULL.dpdmp logfile=dpdump_dir:mySID_FULL.log flashback_time=\"TO_TIMESTAMP('%exportDate%','YYYYMMDD HH24MISS')\" full=y parallel=2
    Here is the same script, except that it is run via an Enterprise Manager Grid Control job - note the difference in the use of the '%' delimiters:
    set ORACLE_SID=mySID
    del d:\oracle\admin\%%ORACLE_SID%%\dpdump\%%ORACLE_SID%%_full.dpdmp
    SET exportDate=%%DATE:~6,4%%%%DATE:~3,2%%%%DATE:~0,2%% %%TIME:~0,2%%%%TIME:~3,2%%00
    echo %%exportDate%%
    d:\oracle\product\10.2.0\db_1\bin\expdp '"/ as sysdba"' job_name=exp_%%ORACLE_SID%%_FULL dumpfile=dpdump_dir:%%ORACLE_SID%%_FULL.dpdmp logfile=dpdump_dir:%%ORACLE_SID%%_FULL.log flashback_time=\"TO_TIMESTAMP('%%exportDate%%','YYYYMMDD HH24MISS')\" full=y parallel=2
    if %%ERRORLEVEL%% neq 0 set TOTALERRORLEVEL=1
    Comments welcome

    The easiest way I know of to do a consistent export is to use this:
    flashback_time=sysdate
    This was broken on earlier versions but is fixed in either 11.1.0.7 or 11.2.
    Another way is to use a sql file like this:
    flashback_sysdate.sql
    set echo off
    set linesize 132
    set heading off
    spool time.par
    select 'flashback_time=' || TO_CHAR(sysdate, 'YYYY-MM-DD HH24:MI:SS') FROM SYS.DUAL;
    spool off
    exit
    This will produce a file called time.par which can be used as a par file. The problem is if you already are using a par file, datapump only lets you use one parfile.
    time.par
    flashback_time=2010-02-25 09:20:55
    ----------

Maybe you are looking for