Set CN Name SameAccoutName UserPrincipalName and distinguished name with powershell

I am trying to set a users  CN, Name, SameAccoutName, UserPrincipalName, and distinguished name to uppercase with PowerShell.
I can set the SAMAccoutName and UPN but I cannot figure out how to set the other 3 attributes.
I am only changing the names to all uppercase.  nothing  more.  The names will not change just the case. 
I have a script i have put together to plug in the info so i just need to do one and i will let the script do the rest.  
Is this possible to change the mentioned attributes with Power-Shell?
I know the below piece works fine for those 2 attributes just cant get the other 3. 
Thanks
Set-ADUser -Identity $user -SamAccountName $upperSAM -UserPrincipalName $upperUPN
Lishron

That will not set anything to uppercase.  You are also missing 90% of the script.  What makes you tnink this will work.
Her is an example:
$name='SomeName'
$name.ToUpper()
In the modern world of computing we do not use all uppercase.  This pracatice was ended in computing shortly after WWII.  Only military teletype maintained this because 90% ot the machines could only pring uppercase.
Uppercase is harder to read and is basically counter to all modern computer conventions.  I notice that office clerks and data entry people whoare minimally trained in computer data entry like all uppercase because they hate having to use the shift
key and being careful to correct text errors.
Any system that requires uppercase will define an entry method that automatically forces upper case.  AD does not require this.
For logons and email case is never considered. any case works as all do caseless compares.
¯\_(ツ)_/¯

Similar Messages

  • How to set up an address book and make labels with numbers or pages?

    How do you set up an address book and make labels with numbers or pages?

    Create an Apple ID - My Apple ID

  • Setting "Friendly name" with keytool

    Hi. I run Java 1.4.1 and Tomcat 4.1. Using keytool, I would like to generate a keystore which generates certificates that have a friendly name that I specify. For example, in Internet Explorer, after installing a certificate as a Trusted Root Authority, I would like to go to Tools->Contents tab->Certificates->Trusted Root Certification Authorities tab, and see under the "Friendly name" column the friendly name that I chose for a certificate. I don't see a -genkey option to specify a friendly name in the keytool help. If there's no way to directly change the certificate's friendly name with keytool, I can change the certificate's friendly name in IE. How may I then import the modified certificate into the keystore and have the webserver reference the keystore to return the modified certificate?
    Thank you.
    Raj

    Friendly Name is an attribute of the certificate defined in PKCS#9:
    5.5.1 Friendly name
    The friendlyName attribute type specifies a user-friendly name of the
    object it belongs to. It is referenced in [17].
    friendlyName ATTRIBUTE ::= {
    WITH SYNTAX BMPString (SIZE(1..pkcs-9-ub-friendlyName))
    EQUALITY MATCHING RULE caseIgnoreMatch
    SINGLE VALUE TRUE
    ID pkcs-9-at-friendlyName
    where
    pkcs-9 OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840)
                                     rsadsi(113549) pkcs(1) 9}
    pkcs-9-at-friendlyName OBJECT IDENTIFIER ::= {pkcs-9 20}
    See RFC2985.
    If you add/change an attribute to an existing certificate its thumbprint (SHA-1 hash) will be changed.
    Apparently keytool can't change such attribute, but see its source at the SCSL J2SDK Source code.

  • Need help in setting file name with special characters in attachment

    Hi
    We have a requirement where we need to set the file name that contains special characters (like Russian) and send mauil using Java mail.
    If we set the file name as such, the attachment in the email contains garbled filename
    Can you pl let me know how to resolve this?
    We should use the file name as attachment name and this will have say special characters. The receiver who gets the mail should get with the correct attachment name
    One important point.. the attachments are opened from MS outlook.
    Thanks and regards
    Ram
    Edited by: 884910 on 13 Sep, 2011 5:00 AM

    Read the FAQ carefully. You don't need to call encodeText unless you're using a really
    old version of JavaMail.
    And, it depends on whether the mail reader you're using is handling encoded parameters
    according to the (new) MIME standard, or according to the (old) non-standard hack.
    Sadly, without knowing what mail reader the recipient is using, it's impossible to use
    encoded filenames that will work everywhere.

  • How to set event name with a apple script

    I use a script to import my photos in iphoto. It's a action folder script.
    This script automatically create albums with the folder's names.
    With the latest version of iphoto and ranking per event, I can not initialize the name events with the names of albums.

    The device has to be set up with the same Wi-Fi network that the iOS device is connected to. The printer cannot be physically connected to the computer. Then select something to print in the iOS device and it will look for a printer and should select yours. See this support document for more help. http://www.apple.com/support/iphone/assistant/airprint/

  • Set file name with XSLT - receiver channel - elements from XML?

    Dear experts,
    I have an XSLT mapping for a message that is sent via a receiver channel to a customer.
    The customer wants a certain file name which is put toghether by elements from the XML message.
    I have looked at:
    Re: Java Map for writing the file
    The java code and the XSLT work perfectly!
    In the line
    fos = new FileOutputStream(new File("Fixed_" + new Date().getTime() + ".xml"));
    a fixed value, date and time are used for the file name.
    But I need some values from the XML message to create my name. But how do I do that? Can I somehow get values from the XML message through that java function or do I have to adapt the XSLT?
    Can someone please help me!
    Thank you,
    Peter

    Hi Udo, Hello experts,
    Now I do have a problem. I am using this XSL file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
        <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, 'TOOLDATA_.xml')" />
      <xsl:copy-of select="." />
    </xsl:template>
    </xsl:stylesheet>
    But then the output file is only named "TOOLDATA_.xml". So I assume the XSL is working.
    And I am using this Java-file:
    package pi_mappings;
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.util.*;
    public class SetFileName extends AbstractTransformation
         static final int BUFFER = 1024*1000;
        private Map param;
        public SetFileName(){  }
         public void setParameter (Map map)
              param = map;
              if (param == null)
                   param = new HashMap();
         public static void main(String args[])
              try
                   InputStream in = new FileInputStream(args[0]);
                   OutputStream out = new FileOutputStream(args[1]);
                   SetFileName sfn = new SetFileName();
                   //sfn.setParameter(mapOfMap);
                   sfn.execute(in, out);
              catch (Exception e)
                        e.printStackTrace();
        public void execute(InputStream inputstream, OutputStream outputstream)
        throws StreamTransformationException {
              try
                   DynamicConfiguration conf = (DynamicConfiguration) param.get("DynamicConfiguration");
                   DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
                   int len = 0;
                   byte buf[] = new byte[BUFFER];
                   FileOutputStream fos = null;
                   if (conf != null)
                        fos = new FileOutputStream(new File(conf.get(KEY_FILENAME) + new Date().getTime()) ); //sample only
                   else
                        fos = new FileOutputStream(new File("Fixed_" + new Date().getTime() + ".xml"));
                        while ((len = inputstream.read(buf)) > 0)
                             outputstream.write(buf, 0, len);
                             fos.write(buf, 0, len);
                        fos.close();          
              catch(Exception e){ e.printStackTrace();}
         public void transform(TransformationInput arg0, TransformationOutput arg1)
         throws StreamTransformationException {
              getTrace().addInfo("JAVA Mapping Called");
         this.execute(arg0.getInputPayload().getInputStream(), arg1
              .getOutputPayload().getOutputStream());
    Could you please help me find the mistake. I tried to test it locally by changing the main-method but I could not get it to work.
    Thank you very much for any ideas!
    Best regards,
    Peter

  • How to set path names with spaces ?

    I want to set a variable to a path name that contains spaces that will work with cd. If I set the variable with
    set p1="My MPW Folder"
    then using echo $p1 yeilds
    My MPW Folder
    however is I do cd $p1 I get
    cd: Too many arguments.
    If I manualy type cd "My MPW Folder" it works. I just don't know which escape character I can use to allow the spaces to be accepted as part of the path name.
    Thanks,
    Power PC G4   Mac OS X (10.3.9)   1.25 GB RAM

    You already know that you can use quotes around a string to keep whitespace as part of the string, so: cd "$p1"
    Dual 1.25 GHz G4 (among others)   Mac OS X (10.3.9)   Fink (obviously)

  • Setting up a New Site and Having Issues with Flash SWF's

    Hello.  I just set up a new site definition, with a testiing server using MAMP Pro, and everything seems to be functioning properly, except that my swf's are not showing up when you publish to a browser from dreamweaver, instead you get the place holder message to upgrade to the newest version of flashplayer... besides the fact that my computers flash player is up to date.  At this point in time my two other websites swf components work just fine when I publish out of dreamweaver.
    I'd also like to mention that the Live View works perfectly and is displayinig the swf's as they should be.
    Thanks!

    I copied the associated scripts over to the site folder on the testing server and I'm getting the same results.  I'm sure this is something that is really simple.  Here is the code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="description" content="Lorentz Painting Co.: Pristine, Precise and Professional" />
    <meta name="keywords" content="Maciej Lorenz, paint, high quality, interior, exterior, co., painting, professional, New England, Vermont, Nassachussetts, Boston, New York New Hampshire, New England" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>The Nantucket Gift Basket Company</title>
    <link href="stylesMain.css" rel="stylesheet" type="text/css" />
    <!--[if lt IE 7]>
    <link rel="stylesheet" type="text/css" href="PNGfix.css" />
    <![endif]-->
    <!--[if lte IE 7]>
    <style type="text/css">
    #hornav ul li { padding: 0 0 0 10px; }
    </style>
    <![endif]-->
    <!--[if lte IE 6]>
    <style type="text/css">
    #wrapper-body, #wrapper-1, #wrapper-2, #wrapper-3 { height: 1%; }
    </style>
    <![endif]-->
    <script type="text/javascript" src="scripts.js"></script>
    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    <style type="text/css">
    #apDiv1 {
        position:absolute;
        width:1844px;
        height:43px;
        z-index:1;
        left: 64px;
        top: 253px;
    body {
        background-color: #FFF;
    a:link {
        text-decoration: none;
    a:visited {
        text-decoration: none;
    a:hover {
        text-decoration: none;
    a:active {
        text-decoration: none;
    </style>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-3119473-5']);
      _gaq.push(['_setDomainName', 'none']);
      _gaq.push(['_setAllowLinker', true]);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-3119473-6']);
      _gaq.push(['_setDomainName', 'none']);
      _gaq.push(['_setAllowLinker', true]);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-3119473-7']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    </head>
    <body>
    <div id="wrapper-body">
    <div id="wrapper-1">
      <div id="branding">
          <h1>
          <div>
            <p>
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="300" id="FlashID" title="The Nantucket Gift Basket Company Logo">
                <param name="movie" value="Nantucket Gift Basket Logo.swf" />
                <param name="quality" value="high" />
                <param name="wmode" value="opaque" />
                <param name="swfversion" value="6.0.65.0" />
                <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                <param name="expressinstall" value="Scripts/expressInstall.swf" />
                <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                <!--[if !IE]>-->
                <object type="application/x-shockwave-flash" data="Nantucket Gift Basket Logo.swf" width="600" height="300">
                  <!--<![endif]-->
                  <param name="quality" value="high" />
                  <param name="wmode" value="opaque" />
                  <param name="swfversion" value="6.0.65.0" />
                  <param name="expressinstall" value="Scripts/expressInstall.swf" />
                  <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                  <div>
                    <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                  </div>
                  <!--[if !IE]>-->
                </object>
                <!--<![endif]-->
              </object>
            </p>
          </div></h1>
        <div>
          <p>
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="50" id="FlashID2" title="The Nantucket Gift Basket Company Navigation Bar">
              <param name="movie" value="NantucketNavBar.swf" />
              <param name="quality" value="high" />
              <param name="wmode" value="opaque" />
              <param name="swfversion" value="6.0.65.0" />
              <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
              <param name="expressinstall" value="Scripts/expressInstall.swf" />
              <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
              <!--[if !IE]>-->
              <object type="application/x-shockwave-flash" data="NantucketNavBar.swf" width="500" height="50">
                <!--<![endif]-->
                <param name="quality" value="high" />
                <param name="wmode" value="opaque" />
                <param name="swfversion" value="6.0.65.0" />
                <param name="expressinstall" value="Scripts/expressInstall.swf" />
                <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                <div>
                  <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                  <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                </div>
                <!--[if !IE]>-->
              </object>
              <!--<![endif]-->
            </object>
          </p>
    </div>
        <div id="wrapper-2">
          <div id="content-top" class="png"></div>
          <div id="wrapper-3">
            <div id="content-2">
              <div class="content-wrap">
                <div id="content-1">
                  <div class="content-wrap">
                    <p>Why Us?</p>
                  </div>
                </div>
                <p> </p>
                <p> </p>
                <p>Pristine, Precise, Professional is our motto at Lorentz Painting Co.  </p>
    <p>We understand how important the appearance of your home or business is to you. We know that first impressions of your home or office are critical to success in any endeavor.  With over ten years in the painting business working in both the residential and commercial sectors, you can have confidence that all of your painting needs will be done in a pristine, precise and professional manner.</p>
                <p><br />
                  To ensure a quality finished product Lorentz Painting Co uses only the industry's finest paints &amp; tools.  We guarantee superb craftsmanship on behalf of our painters, who can work with any paintable surface be it residential or commercial, interior or exterior, oil or latex!  We hope you will consider us for all of your painting needs and we look forward to providing you a high quality service.</p>
                <p> </p>
              <p>Please browse the site to learn more or send us an email using our contact form.</p></div>
            </div>
            <div id="content-bottom"></div>
          </div>
          <div id="footer">
            <p><a href="index.php" title="Lorentz Painting; Why us? We are the best and most affordable painting company in New England, MA, NH, NY, VT, CT, ME and etc.">Why us?</a> - <a href="products_services.php" title="Lorentz Painting Co.: Products &amp; Services; nothing but the finest painting products that can be found in the market., New England, VT, NH, MA, NY, CT, ME">Products &amp; Services</a> - <a href="testimonials.php" title="Feedback about the high quality and affordability of Lorentz Painting Co. Services, New England, VT, NH, MA, NY, CT">Testimonials</a> - <a href="contact.php" title="Contact Lorentz Painting Co. Today for the best painting value in New England, VT, NH, MA, NY, CT">Contact</a></p>
    <p><strong><a href="sitemap.html" title="Site Map of Lorentz Painting Co. the most professional and highest quality painting company in New England, VT, NY, NH, MA, ME, CT">Lorentz Painting Co., 2011</a></strong></p>
            <p><strong><a href="http://cwws.org" title="Common Wealth Web Solutions" target="_new">Designed by CWWS</a></strong></p>
          </div>
        </div>
      </div>
    </div>
    <script type="text/javascript">
    swfobject.registerObject("Lorentz Painting Co.: The best value in painting in New England, NY, VT, NH, MA, ME, CT.  A professional company that produces high quality results.");
    swfobject.registerObject("Lorentz Painting Co.: The most Pristine, Precise and Professional Painting Company in New England, NY, VT, NH, MA, ME, CT.");
    swfobject.registerObject("Lorentz Painting Co.: High Quality painting at an affordable price.  Serving New England, NY, VT, NH, MA, ME, CT.");
    swfobject.registerObject("FlashID");
    swfobject.registerObject("FlashID2");
    </script>
    </body>
    </html>

  • If i have a work ipad with a work email and a shared icloud for all employees, can i set up a second itunes and icloud account with a separate email address on the same ipad for my personal stuff?

    i am a teacher and my school has given all of us a ipad to use. it is set up with my school email and a shared itunues and icloud account. they have told us we can use it for anything that can be used for education purposes. i have downloaded books and other items that i have marked up for my use. however if there is ever a problem i cant identify my applications or books if other teachers have downloaded the same apps or books as well as my documents. is there a way to set up a 2nd itunes account and icloud account so that i may use that when backing up anything that would be personalized by me so that i can find what is rightfully mine. they are ok with it but were unsure how to do this, so can anyone help me? thanks

    Sorry, you cannot use more than one iTunes account at a time.

  • How do I set up my Time Machine and Mac Mini with Lion Server so i have one wifi loop in the house?

    HELP!
    So I have had a Time Machine wifi loop at the house for approx. 6 years. I run two Macbooks, 2 iPhones, 2 iTouch and a Samsung Smart Blueray on the loop.
    I just bought a Mac Mini with Lion Server. When setting it up I'm not sure what or how I managed to do, but I now have 2 wifi loops, one doesn't lock and niether will support the Samsung BlueRay. Also, each time I want to go online with one of the other Mac devices i have to relog into the wifi loop.
    Can someone please walk me through the fix. The mac Mini is plugged straight into the Time Machine to recevie its internet connection.
    Thanks!
    John

    You often see this limit of 10 clients in wireless hotspots but I have yet to see it in an adsl modem.. most strange way to pay for a service that is really irrelevant how many clients you use.
    Have a go .. I recently setup a TC to help a guy run his Roku.. and this setup worked well.. I have no idea if it can work in your case.
    Lets say the IP you get is 192.168.2.1-10 .. doesn't matter what it really is. And the adsl modem is 192.168.2.254
    (Assuming they are private addresses.. if they are public IP you can just use the DHCP and NAT. )
    But go to the airport utility.. I think you need to run v5 at least to change DNS.. but you can do the same thing in v6 using static but no dns changes.
    Now you set the IP of the TC manually.. This address might need to be in the dhcp range of the modem to work. You can set the DNS to same IP as the router address.. ie home address of the modem. Or you can use another DNS.. whatever you like.
    Then set DHCP for clients that will join.. this can then expand the scope of addresses..
    It worked without a NAT error.. although I am not sure exactly how.. on paper it should not be able to work but did.. have a go.. otherwise there is perhaps another way.. but it is complicated.
    Give us an example from a computer plugged into the modem of what IP .. subnet mask .. Gateway and DNS you get. Then I can fine tune the values for it.

  • Get current SQL instance name with PowerShell

    Hi all,
    I'm preparing SQL agent job that will backup all jobs on SQL server. Main step is PoswerShell script. I want that job to be universal for all servers. The first parameter that I need to send to script is instancename.
    I want to use variable as InctanceName parameter. So, when I run this job on particular server this variable must get current SQL instance name.
    I can use $env:computername for default instances but I cannot use it with named instances or with clustered instances. Some solutions like using 'HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL' keys won't work because of number of
    instanses can be running on one machine.
    How to get only current SQL instance name?

    Hi, 
    Thank you for your answers.
    I found this solution:
    $serverInstance = "$(ESCAPE_DQUOTE(SRVR))"
    Working perfect.

  • If I set database mode to Simple and do deleting with batches, Will these delete not written to the Transaction log ?

    Hi
    I have large database and i need to perform batch deleting without affecting the transaction log. So if I set the Recovery mode to Simple before deleting the transaction log will not grow ??
    Thanks.

    Hi
    I have large database and i need to perform batch deleting without affecting the transaction log. So if I set the Recovery mode to Simple before deleting the transaction log will not grow ??
    Thanks.
    You CANNOT delete records in sql server without getting information logged in transaction log. Please note every thing in SQL Server is logged and logging depends on recovery model used. When you use simple recovery logging will
    almost be same as full just after checkpoint logs would be truncated and also when log file grows 70 % of its size. This can only not happen IF some ongoing transaction is not holding the VLF or requires the VLF(virtual
    log file)
    So you made good choice to delete in batches. Also have a look on Lock escalation
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • How do you set up a MacBook Pro and a PC with one Airport Express?

    I have a MacBook and my roommate has a PC and we're trying to set up my new Airport Express at our college so we can hook up our computers and printers to it. I had it so that my laptop worked fine, but hers would "connect" and not really have any internet connection at all. Class starts on Thursday, so help would be kindly appreciated!

    I'm a great believer in the KISS principle.
    Configuration is simple if you start from a factory default condition.  Connect the Airport to AC power and finally to the Internet modem (or modem/router).  Open Airport Utility on your Mac or other computer and accept all of the recommendations.  After confirming that it works, insert your desired administrative and WiFi passwords.
    Do not expect the Airport to respond instantly to the configuration commands.  BE PATIENT!

  • Reading NTFS permissions and changing them with PowerShell

    Hi,
    I have a large folder structure which contains the shares for several sites.  I've been asked to change the permissions for a group on each of these folders from 'full control' to 'read and execute' on the top level only.  My problem is that the
    name of the group to change is different on each folder.  They follow the same naming convention however which I've attempted to show in the example below.
    Folder1 has a group named FOL1-AdminUsers which has full control, there are several other administrative AD groups with permissions to the folder which must remain the same.  Similarly there is a Folder2 which has a group named FOL2-AdminUsers
    which needs to be changed and so on.
    The part of the script I'm having trouble with is reading the existing permissions from a specific folder and searching for the group I need to change.  Everything else has been fairly straight forward but I've just become completely stuck
    on this.  I'd really appreciate any help anybody could give me or if you could point me in the right direction for further assistance.     
    Many thanks,
    Gary.

    Hi Gary,
    you can read access permissions from a folder by using the Get-Acl cmdlet (Get-Acl "C:\ExampleFolder"). This will return an
    DirectorySecurity object. This comes with an Access CodeProperty that will return all permissions on the folder:
    $Acl = Get-Acl "C:\ExampleFolder"
    $Acl.Access
    It has many useful methods as well, so check out its members:
    $Acl | Get-Member
    Finally, there are useful tools for manipulating Acls, notably the official Set-Acl cmdlet or Rohn's AccessControl Module (Thanks Rohn, it's awesome) in the Gallery.
    If the module is a bit complex for you, there are some simple functions - shameless advertisement incoming - you could instead use: New-AccessRule and
    Add-AccessRule.
    Cheers,
    Fred
    There's no place like 127.0.0.1
    Thanks for the compliment!
    Gary, Rhys and Fred already mentioned that the info you're looking for is in the Access property when you use the built-in Get-Acl cmdlet. You could also use the Get-AccessControlEntry function from
    the module Fred mentioned:
    # List all ACEs for a single folder
    Get-AccessControlEntry C:\Folder
    # List all ACEs for specific principals (this example searches for two):
    Get-AccessControlEntry C:\Folder -Principal FOL*AdminUsers, AnotherUserNameHere
    # List ACEs for all subfolders (uses PSv3 syntax):
    dir C:\Folder -Directory -Recurse | Get-AccessControlEntry

  • Get last logon time,computer and username together with Powershell

    I have a script which gets the last logon times of each computer in the domain.
    My script:
    $dcs = Get-ADComputer -Filter { OperatingSystem -NotLike '*Server*' } -Properties OperatingSystem
    foreach($dc in $dcs) {
    Get-ADComputer $dc.Name -Properties lastlogontimestamp |
    Select-Object @{n="Computer";e={$_.Name}}, @{Name="Lastlogon"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp)}}
    ==================================
    Result:
    Computer Lastlogon
    DC1 6/06/2013 16:38:24
    DC2 6/06/2013 16:30:40
    =============================================I also want to get who/which account made this logon. For example:Computer Lastlogon User
    DC1 6/06/2013 16:38:24 user2
    DC2 6/06/2013 16:30:40 user1

    I also want to get who/which account made this logon. For example:Computer Lastlogon User
    DC1 6/06/2013 16:38:24 user2
    DC2 6/06/2013 16:30:40 user1
    The last logon from aD is the last time the computer account authenticated on AD.  It has nothing to do with a user.
    Get-ADComputer will not return DCs. It will return all workstations.
    To find the last logon for a specific computer just query the computers security log for event 529(XM-2003) or 4672 Get the newest one.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • Enable Jobs with not immediate.

    Hi , We have a job that used to run in predefined time , created by DBMS_SCHEDULER.create_job. If the job is in disable state and if I enable it  the Job start Immediately. Can you enable it , so that it start execution on it predefined time and not

  • Minimum permissions to allow an end-user to create linked reports?

    User has Browser and Content Manager permissions at the SSRS folder level. I'm finding I have to add them to the SCDW_Administrators role before they can create/save Linked Reports - seems excessive, so looking to see if there's a better solution O.

  • When opening a PDF I get a APPCRASH problem

    Im unable to open a PDF, the doc opens up but then closes very shortly afterwards, the problem is as follows Problem signature:   Problem Event Name: APPCRASH   Application Name: AcroRd32.exe   Application Version: 11.0.10.32   Application Timestamp:

  • ITunes 10

    Hi all, I just have been careful to upgrade to iTunes10, because I had some problems with iOS4 for my iPhone 3GS. Now I saw some problems with iTunes 10 (artwork and others) after this upgrade. I hope, the original files of artwork are still on your

  • Best Practices for converting SAP HR data (4.7 to ECC)

    Hello Experts ... We are going from 4.6 to ECC ... no upgrade ..it will be a new implementation ... I am looking for best practices to convert SAP HR data from one sap instance(4.6) to another(ECC) ... I am not sure if direct input or LSMW or any oth