Hot answers tagged

4

First, create an object with all the data like this: $Path = "location of csv" $Users = Get-Content -Path $Path | ConvertFrom-CSV Then just iterate through the rows of data like this: $Users | %{ #Set ad user stuff using $_.Attribute }


2

Single quotes will do it; escaping the space then is optional: \i '/home/markus/Documents/Projekte/My\ App/Installation/server_sql_script.sql'


2

Because when you dump data (Backup) you used "mysqldump" : mysqldump -u user -p Database_name > SQL_dump_file.sql But when restore data into database you need to use only "mysql": mysql -u user -p Database_name < SQL_dump_file.sql


1

Looks like you've set the UPN correctly but are not putting it in the new-aduser command? UPN is optional so the account can be created without it.


1

As you don't mention an Active Directory, I found a powershell script example to create local username from an CSV. CreateaHundredUsersFromCSVFile.ps1 Import-Module -Name LocalUserModule If(!(Test-IsAdministrator)) { “This module requires admin rights.” ; exit } New-LocalGroup -GroupName testgroup -description “for 100 users” Import-Csv ...


1

Try the following: Import-Csv C:\sam-eid.csv | ForEach-Object { Set-ADUser $_.samAccountName -Replace @{ExtensionAttribute7=$_.ExtensionAttribute7} } You may have a syntax issue $._ versus $_.


1

The only way that I can find to do this is to do an image-copy after the import. The image-copy command takes name and description parameters, which will then be given to the copy. aws ec2 copy-image --source-image-id ami-123de3 --source-region us-east-1 --region us-east-1 --name <new-name> --description <description> After that completes ...


1

Given that the output is programmatically generated, I assume that the syntax error is entirely regular. In that case, you can almost certainly solve the problem by replacing the string ,\n) with ), using a scripting solution of your choice (sed, perl, or whatever else butters your muffin).



Only top voted, non community-wiki answers of a minimum length are eligible