Set Folder Permission with CSV File

I currently have a batch file that I use to set the folder permission on a users folder.  The batch file of course requires me to manually set two variables.  I'd like to have a master csv file containing this info and a powershell script to allow
me to set these permission much more quickly.  Here's my current batch file:
Set User=123A
Set Folder=123
icacls C:\Data\%folder% /grant %user%:(OI)(CI)F
My csv file would appear as 123A,123
I did do a search and found a few posts on this subject, but couldn't wrap my head around how to modify them to fit my needs.
Kevin

FOR /F "eol=; tokens=1,2* delims=, " %%i in (myfile.txt) do icacls C:\Data\%%j /grant %%i:(OI)(CI)F
¯\_(ツ)_/¯

Similar Messages

  • Setting folder permission in windows 8.1

    setting folder permission in windows 8.1

    Hi,
    You can set the share and NTFS permissions on a file\folder, I'd like to share the following links with you:
    (Permissions in Windows 8.1 are similiar to Windows 7)
    http://windows.microsoft.com/en-in/windows/what-are-permissions#1TC=windows-7
    https://technet.microsoft.com/en-in/library/cc772196.aspx?f=255&MSPPError=-2147217396
    https://technet.microsoft.com/en-us/library/cc770962.aspx
    Yolanda Zhu
    TechNet Community Support

  • Send mails with csv file as an attachment through oracle(SQL SCripts / Stor

    Hello Everybody,
    I have recently come across a requirement in which I am supposed to send mails with csv file as an attachment through oracle(SQL SCripts / Stored Procedure) .
    The contents of the csv file are to be retreived from the Database as well as the content of the mail and to whom it needs to be sent has also to be picked up from the database.
    Can somebody suggest me with a suitable code for the same?
    Would be of great help..!!
    Thanks & Regards,
    - VR
    Edited by: user646716 on Dec 18, 2009 10:44 AM

    read below links
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:255615160805
    http://www.orafaq.com/wiki/Send_mail_from_PL/SQL#Send_mail_with_UTL_TCP_-withattachments
    How to send csv file as an attachment

  • Export Public Folder contacts to CSV File using Exchange management Shell

    Hi All
    Is there a command i can run in the exchange management shell to export all public folder contacts (which are in many sub folders) to a CSV file?
    Any help on this appreciated.
    Ben Weinberg
    Prime-Networks
    www.prime-networks.co.uk
    Please post the resolution to your issue so that everyone can benefit
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Hello Ben,
    Per my knowledge, you cannot use Exchange Management Shell to export the contacts in public folder to csv file.
    If you want to export contacts in public folder to a csv file, you can follow this way to do that:
    Open Outlook and create a Temp Contact Folder
    Move all the contacts to the Temp Contact Folder
    Use Outlook export contacts to csv file .
    Thanks,
    Evan Liu
    TechNet Subscriber Support
    in forum
    If you have any feedback on our support, please contact
    [email protected]  

  • Setting required to process incomming Email with CSV file attached

    Dear all,
    We are having a scenario where in the supplier receives a PO confirmation CSV file from the download center as an Email attachment. The supplier updates the file by confirming PO's and replies back. The CSV file needs to update the confirmed PO's in SNC.
    The SO50 settings are in place but still we are not able to receive the Email back in SNC. Any suggestion on what settings we need in SNC to receive and process the CSV file?
    thanks,
    mahehs

    Hi,
    You can use the upload center to process the changed data. Isnt that helpful?
    Best Regards,
    Harsha Gatt

  • Dynamically creating oracle table with csv file as source

    Hi,
    We have a requirment..TO create a dynamic external table.. Whenever the data or number of columns change in the CSV file the table should be replaced with current data and current number of columns...as we are naive experienced people in oracle please give us a clear solution.. We have tried with a code already ..But getting some errors. Code given below..
    thank you
    we have executed this code by changing the schema name and table name ..Remaining everything same ...
    Assume the following:
    - Oracle User and Schema name is ALLEXPERTS
    - Database name is EXPERTS
    - The directory object is file_dir
    - CSV file directory is /export/home/log
    - The csv file name is ALLEXPERTS_CSV.log
    - The table name is all_experts_tbl
    1. Create a directory object in Oracle. The directory will point to the directory where the file located.
    conn sys/{password}@EXPERTS as sysdba;
    CREATE OR REPLACE DIRECTORY file_dir AS '/export/home/log';
    2. Grant the directory privilege to the user
    GRANT READ ON DIRECTORY file_dir TO ALLEXPERTS;
    3. Create the table
    Connect as ALLEXPERTS user
    create table ALLEXPERTS.all_experts_tbl
    (txt_line varchar2(512))
    organization external
    (type ORACLE_LOADER
    default directory file_dir
    access parameters (records delimited by newline
    fields
    (txt_line char(512)))
    location ('ALLEXPERTS_CSV.log')
    This will create a table that links the data to a file. Now you can treat this file as a regular table where you can use SELECT statement to retrieve the data.
    PL/SQL to create the data (PSEUDO code)
    CREATE OR REPLACE PROCEDURE new_proc IS
    -- Setup the cursor
    CURSOR c_main IS SELECT *
    FROM allexperts.all_experts_tbl;
    CURSOR c_first_row IS ALLEXPERTS_CSV.logSELECT *
    FROM allexperts.all_experts_tbl
    WHERE ROWNUM = 1;
    -- Declare Variable
    l_delimiter_count NUMBER;
    l_temp_counter NUMBER:=1;
    l_current_row VARCHAR2(100);
    l_create_statements VARCHAR2(1000);
    BEGIN
    -- Get the first row
    -- Open the c_first_row and fetch the data into l_current_row
    -- Count the number of delimiter l_current_row and set the l_delimiter_count
    OPEN c_first_row;
    FETCH c_first_row INTO l_current_row;
    CLOSE c_first_row;
    l_delimiter_count := number of delimiter in l_current_row;
    -- Create the table with the right number of columns
    l_create_statements := 'CREATE TABLE csv_table ( ';
    WHILE l_temp_counter <= l_delimiter_count
    LOOP
    l_create_statement := l_create_statement || 'COL' || l_temp_counter || ' VARCHAR2(100)'
    l_temp_counter := l_temp_counter + 1;
    IF l_temp_counter <=l_delimiter_count THEN
    l_create_statement := l_create_statement || ',';
    END IF;
    END;
    l_create_statement := l_create_statement || ')';
    EXECUTE IMMEDIATE l_create_statement;
    -- Open the c_main to parse all the rows and insert into the table
    WHILE rec IN c_main
    LOOP
    -- Loop thru all the records and parse them
    -- Insert the data into the table created above
    END LOOP;

    The initial table is showing errors and the procedure is created with compilation errors
    After executing the create table i am getting the following errors
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "identifier": expecting one of: "badfile,
    byteordermark, characterset, column, data, delimited, discardfile,
    disable_directory_link_check, exit, fields, fixed, load, logfile, language,
    nodiscardfile, nobadfile, nologfile, date_cache, processing, readsize, string,
    skip, territory, varia"
    KUP-01008: the bad identifier was: deli
    KUP-01007: at line 1 column 9
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

  • Comparing SQL Data Results with CSV file contents

    I have the following scenario that I need to resolve and I'm unsure of how to approach it. Let me explain what I am needing and what I have currently done.
    I've created an application that automatically marks assessments that delegates complete by comparing SQL Data to CSV file data. I'm using C# to build the objects required that will load the data from SQL into a dataset which is then compared to the
    associated CSV file that contains the required results to mark against.
    Currently everything is working as expected but I've noticed that if there is a difference in the number of rows returned into the SQL-based dataset, then my application doesn't mark the items at all.
    Here is an example:
    ScenarioCSV contains 4 rows with 8 columns of information, however, let's say that the delegate was only able to insert 2 rows of data into the dataset. When this happens it marks everything wrong because row 1 in both CSV and dataset files were correct,
    however, row 2 in the dataset holds the results found in row 4 in the CSV file and because of this it is comparing it against row 2 in the CSV file.
    How can I check whether a row, regardless of its order, can be marked as it does exist but not in the same order, so I don't want the delegate to lose marks just because the row data in the dataset is not perfectly in the same order of the row data
    in the CSV file???
    I'm at a loss and any assistance will be of huge help to me. I have implemented a ORDER BY clause in the dataset and ensured that the same order is set in the CSV file. This has helped me for scenarios where there are the right number of rows in the dataset,
    but as soon as there is 1 row that is missing in the dataset, then the marking just doesn't allow for any marks for both rows even if the data is correct.
    I hope I've made sense!! If not, let me know and I will provide a better description and perhaps examples of the dataset data and the csv data that is being compared.
    Thanks in advance....

    I would read the CSV into a datatable using oledb. Below is code I wrote a few weeks ago to do this.
    Then you can compare two datatables by a common primary key (like ID number)
    Below is the webpage to compare two datatables
    http://stackoverflow.com/questions/10984453/compare-two-datatables-for-differences-in-c
    You can find lots of examples by perform following google search
    "c# linq compare two dattatable"
    //Creates a CSVReader Class
    public class CSVReader
    public DataSet ReadCSVFile(string fullPath, bool headerRow)
    string path = fullPath.Substring(0, fullPath.LastIndexOf("\\") + 1);
    string filename = fullPath.Substring(fullPath.LastIndexOf("\\") + 1);
    DataSet ds = new DataSet();
    try
    if (File.Exists(fullPath))
    string ConStr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" + ";Extended Properties=\"Text;HDR={1};FMT=Delimited\\\"", path, headerRow ? "Yes" : "No");
    string SQL = string.Format("SELECT * FROM {0}", filename);
    OleDbDataAdapter adapter = new OleDbDataAdapter(SQL, ConStr);
    adapter.Fill(ds, "TextFile");
    ds.Tables[0].TableName = "Table1";
    foreach (DataColumn col in ds.Tables["Table1"].Columns)
    col.ColumnName = col.ColumnName.Replace(" ", "_");
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    return ds;
    jdweng

  • Csvde update user info with csv file

    I see many ways how to do this online but I don't understand how to write the entire script myself from what's being showed online, being it from a video or from another forum - due to everyone else s' methods involves different scenarios.
    I would like know what does my excel/csv file need to look like if I'm updating only each AD object inside an OU with the following:
    TELEPHONE NUMBER, FAX NUMBER, MOBILE NUMBER, TITLE - the other entries are already there, such as web address, email address, display name.
    And then what am I going to add in the command line: CSVDE -i -f mailboxdetails.csv ect?

    I agree with Ed.
    If you have a Windows 2008 R2 AD in place , you can achive this goal by using a .csv file and a script with couple of lines in PowerShell  .
    First create the csv file which must contains the following header and its value  (any other if you want) :
    SamAccountName,Title,FaxNumber,MobilNumber,TelephoneNumber 
    then use the below script :
    Import-Module activeDirectory
    $allusers =Import-Csv c:\users.csv
    foreach($user in $allusers)
    Set-aduser -identity $user.samaccountname -Title $user.title -mobilePhone $user.mobileNumber -Fax $user.faxNumber -add @{TelephoneNumber=$user.telephonenumber }
    Note : just change the .csv file name and it's path .
    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. ---------- MCITP - Exchange 2010 | MCITP - Windows Server 2008 R2

  • Set-ADUser based on .csv file - empty attributes issue

    Hi, after a few months without working with PowerShell my knowledge is slowly fading away but fortunately every time this happened before, I was able to rebuild my knowledge again and now it is the same story. However I want to optimize my simple
    code which populates three AD user object attributes: manager, officephone and fax with values stored in .csv file. Everything works well, but my code looks not so good in my opinion. Is there any more elegant solution?
    $AddressBook = Import-CSV -Path D:\AddressBookFinal.csv
    foreach($Employee in $AddressBook)
         if([string]::IsNullOrEmpty($Employee.ManagerUserName)) {
                  Set-ADUser -Identity $Employee.EmployeeUserName -Manager $null
        } else {
                  Set-ADUser -Identity $Employee.EmployeeUserName -Manager $Employee.ManagerUserName
        <#similar code here for checking value of OfficePhone and Fax attributes and populating             AD attributes depending on if attribute value in .csv file is empty or not#> 

    Hi BoxiKG,
    If there is any other question regarding this issue, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • AM/PM does not import with csv files

    Hello All,
    I am loading various csv files into DIAdem using the DataPlugin Wizard.  My files contain time channels in the format 03/21/2011 01:32:24 PM or AM.  When the data is imported the AM/PM is lost so my time skips backwards.  After 12:59 when the data jumps to 1:00 and there is no AM or PM or 13:00 so I end up with a large gap in my data and the end of the data becomes the beginning.  I have tried the various date format options in the wizard and even tried typing in "pp" after the time.  I have also tried importing the data as txt and ascii.  Am I missing something simple?  Thanks for any insight!

    Hi SolarTech,
    I went ahead and wrote a quick DataPlugin to read your posted CSV file which has no file extension.  You say that you're using DIAdem 2011, but actually at the moment only DIAdem 2010 is released, so I'm assuming this is what you actually have.  DIAdem 2010 is the first version that supports automatic association of "no-file-extension" with a DataPlugin, and this is how I've set up the DataPlugin I'm attaching.  That means that once you detach the ZIP file and unzip it and then double-click on the "SolarTech_CSV.uri" file to register the DataPlugin, that you'll be able to just drag your extensionless (CSV) data files from the NAVIGATOR to the Data Portal to load them.  This also means that the DataPlugin won't work on any DIAdem versions prior to 2010.
    Your AM/PM info looks like it's importing correctly to me with the DataPlugin I wrote.  Note that by default DIAdem displays date/time values with 24 hour syntax, but you can configure date/times to display with AM/PM everywhere except on the axes of VIEW graphs.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    SolarTech_CSV.zip ‏2 KB

  • Shared mailbox - check if user have permission from csv file

    Hi all,
    i know this is a long shot,but i still belive in Santa.Here is our situation.
    We grant our users access to Shared mailboxes by joining them to a security group (mail enabled) that starts with RG-XXX.
    Then i ran following command to list all users that are not member of a group starting with RG:
    $groups = Get-ADGroup -Filter {(name -like "*RG-Full*") -or (name -like "*RG-SEND*") -or (name -like "*RG-OS*")} | Select -ExpandProperty DistinguishedName
    foreach ($group in $groups){ $ADUsers = $ADUsers | Where-Object { $_.MemberOf -notcontains $group } }
    $FilteredUsers = $ADUsers
    $FilteredUsers | Export-Csv C:\temp\file.csv
    This worked great and i got a list of people that is not member of these groups.Problem is that some users are granted permission directly to the shared mailbox.This means that some people on the list still have access to a shared mailbox.
    Question is,can i use this list (.csv file containing alias) and run another check to see if they have been granted access to any shared mailbox?
    Thanks!
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you. Thank you! Off2work

    You need to pipe the last one:
    $arrMsolUserData | Export-CSV C:\scripts\output.csv -nti
    Also, you might need to adjust the value of $user depending on the format you used in the CSV. If the column in the CSV is named "alias", you might have to use $user.alias instead of just $user in the
    Get-MailboxPermission cmdlet.
    Here's an updated example:
    $usertocheck = Import-CSV C:\scripts\file.csv
    #Get all the shared mailboxes
    $shared = Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited
    #create the aggregate and cycle all the objects
    $arrMsolUserData = @()
    foreach ($user in $UserToCheck) {
    foreach ($MB in $shared) {
    $MBrights = Get-MailboxPermission -Identity $MB.PrimarySmtpAddress -User $user.alias
    if (!$MBrights) { continue }
    $objUser = New-Object PSObject
    $i++;Add-Member -InputObject $objUser -MemberType NoteProperty -Name "Number" -Value $i
    Add-Member -InputObject $objUser -MemberType NoteProperty -Name "User" -Value $user.Alias
    Add-Member -InputObject $objUser -MemberType NoteProperty -Name "Mailbox" -Value $MB.PrimarySmtpAddress
    Add-Member -InputObject $objUser -MemberType NoteProperty -Name "Access Rights" -Value $MBrights.AccessRights
    $arrMsolUserData += $objUser }
    $arrMsolUserData | Export-CSV C:\scripts\output.csv -nti

  • Web.show_document() with .csv-Files

    Hallo,
    when I try to show a .csv-file using web.show_document in MS-Excel I'm facing the following problem:
    Depending on the windows-settings (?) before showing the Excel-sheet the browser opens an alert 'open/save file'.
    When this alert is activated the web.show-document() is not successfull, that means: it seems that the browser tries to open the new window but it immediatly 'crashes' (I'm using '_blank' as parameter).
    When this alert is not activated everything works perfect.
    My guess is that it has something to do with whith the javascript-problem under XP-SP2. (i also can't get javascript working together with web.show_document).
    Enviroment is: Forms 10g, Windows XP SP2, MS-IE (Mozilla works fine), 10g iDS and iAS
    any ideas?
    tia
    Frank

    Hello,
    already done, doesn't help.
    The odd thing is: when I type the url web.show_document should show directely into the IE (with virtual pathname) the alert shows up, I can choose 'open' and it works (thats the way I get rid of the alert). It seems to me that showing the alert somehow causes the problem in combination with web.show_document.
    I have a similar problem with javascipt. When I type it directly into the browser everything works fine, from web.show_document .. no way.
    So my guess was that maybe the alert itself uses javascript. I dont know much about java and browsers and so its really only a guess.
    The Alert I'm talking about is the following (modulo translation errors):
    do you want to open or save the file
    Name... / Type... /from....
    open/save/cancel -Buttons
    checkbox: always ask before opening a file of this type
    Frank

  • Error while running bulk load utility for account data with CSV file

    Hi All,
    I'm trying to run the bulk load utility for account data using CSV but i'm getting following error...
    ERROR ==> The number of CSV files provided as input does not match with the number of account tables.
    Thanks in advance........

    Please check your child table.
    http://docs.oracle.com/cd/E28389_01/doc.1111/e14309/bulkload.htm#CHDCGGDA
    -kuldeep

  • Data set created out of csv file: columns not recognized, too many rows

    After uploading a csv file I got out of the OPP the columns don't get recognized in the dataset viewer. Perhaps this happens because the delimiter is a semicolon instead of a comma? Unfortunately, I have no influence how the data gets exported out of the OPP. Is there any option to configure which delimiter to recognize, like it's possible in excel?
    Further, is it possible to configure from which row on the data should be taken into account, similar to excel? With the csv file I get out of the OPP, the data only starts with row 7, while row 6 has the headings.

    After uploading a csv file I got out of the OPP the columns don't get recognized in the dataset viewer. Perhaps this happens because the delimiter is a semicolon instead of a comma? Unfortunately, I have no influence how the data gets exported out of the OPP. Is there any option to configure which delimiter to recognize, like it's possible in excel?
    The delimiter cannot be configured. Comma is the delimiter. I would suggest that you open this file in text editor then replace semicolon with comma. After that you can reupload your dataset.
    Further, is it possible to configure from which row on the data should be taken into account, similar to excel? With the csv file I get out of the OPP, the data only starts with row 7, while row 6 has the headings.
    This is not configurable as well.

  • SOAP Axis sender with CSV file attachment

    Hi Experts,
    I have a requirement where I receive a CSV file attachment from a Web Service post ( i.e a SOAP sender with attachment). I decided to use SOAP with Servlet(Axis) protocol, since standard SOAP sender does not allow modules to be used.
    I am able to test this interface through SOAPUI with attachment to the point where I can get the attachment payload as my main payload in IE, but it fails in mapping since CSV needs to be converted to XML. I have following queries for proceeding ahead with this scenario:
    1. How do I convert the CSV attachment to XML inorder for mapping to be used in IE. Is there a standard axis handler available for this ???? Also where should this handler be called in the sequence of Axis modules ???
    2. Can I use MessageTransformationBean for converting plain to XML ??? If yes where should this module be called in the sequence of Axis modules. I tried using this module between the CallSapAdapter and the first AdapterBean but it returns exception in SOAPUI saying " Messaging exception: No Main"
    3. Is there a blog available which illustrates about using additional modules/handlers in Axis. I have had a look at the FAQ note of Axis but it just gives the overview.
    Thanks.
    Siddhesh S.Tawate

    Solved :).
    1     AF_Adapters/axis/HandlerBean                     Local Enterprise Bean                              xireq
    2     AF_Adapters/axis/AFAdapterBean                     Local Enterprise Bean                              afreq
    3     localejbs/AF_Modules/MessageTransformBean    Local Enterprise Bean                     Plain2XML
    4     CallSapAdapter                                          Local Enterprise Bean                              sap
    5     AF_Adapters/axis/AFAdapterBean                    Local Enterprise Bean                             afresp
    6     AF_Adapters/axis/HandlerBean                    Local Enterprise Bean                             xires
    Above sequence worked. I guess I was missing some parameter in content conversion earlier.
    Thanks.

Maybe you are looking for

  • How do I import an iTunes library stored by a different user on the same macbook?

    My husband and I are used to share the same Library and we just have our own playlists. I finally was able to import the my libary from my old Windows computer, but now I face another challenge: Now I can only see the music files when logged in as us

  • Port issue with j2ee engine, http service provider

    hi gurus, on two of our standalone j2ee servers, the j2ee engine is up and running fine. from the mmc everything shows green including messager server. but when i connect to the j2ee page using browser either from the client machine or  on the server

  • TV Tuner for Mac Pro?

    Is there any TV Tuners for the Mac Pro? Thank You.

  • Business area in accounting document

    Hi guys, I have a problem in accounting document generated by VF01. The business area displayed is retrieved from TVTA while the user wants the business area to be taken from T134G. Do you have an idea what is the basis in getting the value for the B

  • XP 64 users what version of firefox works best for you

    xp64 is not supported and never has been, outside of that some versions of firefox work quite well with this OS, looking to find which version has proved to be most successful with minimal operational problems.