Export-CSV as a different user
Wrote a sript to audit a few reg keys and other vitals from the computer. Eventually I will have this go to a database but in the meantime I am trying to write it to a text file. These are mobile computers that log in as a generic local user.
The powershell script as is needs to write to a domain file and therefore doesnt have permissions. Can someone help me use different creds within the powershell script to use for access?
The Export-CSV function is in use for the append switch as these are powershell v2
#Get Local User SID for use as primary key
$CS = Gwmi Win32_ComputerSystem -Comp "."
$CS.UserName
$objUser = New-Object System.Security.Principal.NTAccount($CS.UserName)
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
#$strSID.value
#Get Versions
$SoftwareVersionKey = 'HKLM:\SOFTWARE\Wow6432Node\Software1\Portal'
$SoftwarePackageVersion = (Get-ItemProperty -path $Software1VersionKey).VERSION1
$Software1Version = (Get-ItemProperty -path $Software1VersionKey).Version1
#$Software1PackageVersion
#$Software1Version
#Get Software1 GUID
$Software1Key = 'HKLM:\SOFTWARE\Wow6432Node\Software1'
$Software1GUID = (Get-ItemProperty -path $Software1Key).GUID
#$Software1GUID
#Get Software1 Datasync Identity
$Software1DSIdentKey = 'HKLM:\SOFTWARE\Wow6432Node\Software1\SyncAgent'
$Software1Identity = (Get-ItemProperty -path $Software1DSIdentKey).Identity
#$Software1Identity
#Get Computer Information / Computer Name / Installed Memory (MB)
$WMI = Get-WmiObject -Class Win32_ComputerSystem
$computername = ($WMI.name)
$computerDomain = ($WMI.Domain)
$computerManufacturer = ($WMI.Manufacturer)
$computerModel = ($WMI.Model)
$InstalledMemory = ($WMI.TotalPhysicalMemory/1mb)
#Get Computer Information / Computer Name / Installed Memory (MB)
$WMIBIOS = Get-WmiObject -Class Win32_BIOS
$BIOSVersion1 = ($WMIBIOS.SMBIOSBIOSVersion)
$BIOSVersion2 = ($WMIBIOS.Version)
$computerSerial = ($WMIBIOS.SerialNumber)
#Date
$date = Get-Date -format "yyyyMMdd"
function Export-CSV {
[CmdletBinding(DefaultParameterSetName='Delimiter',
SupportsShouldProcess=$true, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[System.Management.Automation.PSObject]
${InputObject},
[Parameter(Mandatory=$true, Position=0)]
[Alias('PSPath')]
[System.String]
${Path},
[Switch]
${Append},
[Switch]
${Force},
[Switch]
${NoClobber},
[ValidateSet('Unicode','UTF7','UTF8','ASCII','UTF32',
'BigEndianUnicode','Default','OEM')]
[System.String]
${Encoding},
[Parameter(ParameterSetName='Delimiter', Position=1)]
[ValidateNotNull()]
[System.Char]
${Delimiter},
[Parameter(ParameterSetName='UseCulture')]
[Switch]
${UseCulture},
[Alias('NTI')]
[Switch]
${NoTypeInformation})
begin
$AppendMode = $false
try {
$outBuffer = $null
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))
$PSBoundParameters['OutBuffer'] = 1
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Export-Csv',
[System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmdPipeline = ''
if ($Append) {
$PSBoundParameters.Remove('Append') | Out-Null
if ($Path) {
if (Test-Path $Path) {
$AppendMode = $true
if ($Encoding.Length -eq 0) {
$Encoding = 'ASCII'
$scriptCmdPipeline += 'ConvertTo-Csv -NoTypeInformation '
if ( $UseCulture ) {
$scriptCmdPipeline += ' -UseCulture '
if ( $Delimiter ) {
$scriptCmdPipeline += " -Delimiter '$Delimiter' "
$scriptCmdPipeline += ' | Foreach-Object {$start=$true}'
$scriptCmdPipeline += '{if ($start) {$start=$false} else {$_}} '
$scriptCmdPipeline += " | Out-File -FilePath '$Path'"
$scriptCmdPipeline += " -Encoding '$Encoding' -Append "
if ($Force) {
$scriptCmdPipeline += ' -Force'
if ($NoClobber) {
$scriptCmdPipeline += ' -NoClobber'
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
if ( $AppendMode ) {
$scriptCmd = $ExecutionContext.InvokeCommand.NewScriptBlock(
$scriptCmdPipeline
} else {
$scriptCmd = $ExecutionContext.InvokeCommand.NewScriptBlock(
[string]$scriptCmd
$steppablePipeline = $scriptCmd.GetSteppablePipeline(
$myInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
throw
process
try {
$steppablePipeline.Process($_)
} catch {
throw
end
try {
$steppablePipeline.End()
} catch {
throw
New-Object -TypeName PSCustomObject -Property @{
UserSID = $strSID.value
ComputerName = $computername
Domain = $computerDomain
ComputerManufactor = $computerManufacturer
ComputerModel = $computerModel
ComputerSerial = $computerSerial
InstallMemory = $InstalledMemory
BIOS1 = $BIOSVersion1
BIOS2 = $BIOSVersion2
Software1PackageVersion = $Software1PackageVersion
Software1Version = $Software1Version
Software1GUID = $Software1GUID
Software1Identity = $Software1Identity
Date = $date
} | Export-Csv -Path '\\server\drive\IT Shared\Audittest.csv' -NoTypeInformation -Append
To shorten this code up a little... really here is the last part that I am trying to do. Just want to send variable data to text file but cant due to logged in user.
New-Object -TypeName PSCustomObject -Property @{
UserSID = $strSID.value
ComputerName = $computername
Domain = $computerDomain
ComputerManufactor = $computerManufacturer
ComputerModel = $computerModel
ComputerSerial = $computerSerial
InstallMemory = $InstalledMemory
BIOS1 = $BIOSVersion1
BIOS2 = $BIOSVersion2
Software1PackageVersion = $Software1PackageVersion
Software1Version = $Software1Version
Software1GUID = $Software1GUID
Software1Identity = $Software1Identity
Date = $date
} | Export-Csv -Path '\\server\drive\IT Shared\Audittest.csv' -NoTypeInformation -Append
Similar Messages
-
Export-CSV Not working for a user
Hi Guys,
Here's a good one for you. I have a client who is trying to run the script Get-ScheduledTasks.ps1 with the option to export-csv. So he's running .\get-scheduledTask.ps1 | Export-CSV C:\schedtask\schedtask.csv The script runs just fine but doesn't output
to the csv it just displays the output in the ISE console window. It does this if he's logged onto his laptop, the server itself, as him or as another local account.
Here's the weird thing I can run the script just fine on both my laptop, and the server, logged on as myself or as the same local user he tried to run the script on and it works just fine. There are no errors when he runs the script it just refuses to output
to the CSV file for him, no matter who he's logged on as.
If anyone has come across this before and knows why.
TIAIf you carefully read the script you posted it clearly states that it outputs nothing.
Somewhere you are doing two different things.
I suggest getting an analyst to follow both of you around and discover what you are doing. One of you is a bit deluded about what is happening.
Prepare yourself for a big embarrassment.
Here is what it says in the directions for the script you posted the link for:
.OUTPUTS
Nothing
There is no output to send to a CSV.
The internal code does the following:
$tasks = & schtasks /query /s $ComputerName /fo csv /v | ConvertFrom-Csv
See - no output.
THen it does this:
Send-MailMessage -Body $TasksInError -BodyAsHtml -From [email protected] -SmtpServer mysmtpserver.mydomain.com -Subject "Scheduled Tasks Report - $ComputerName" -To [email protected]
See - still no output.
That is all there is in your script. Go back and retest and pay close attention to what you are doing.
¯\_(ツ)_/¯ -
All help instructions are for importing or exporting bookmarks/favourites between different brands of browsers.
Many thanks twalker for your prompt and simplified explanation for resolving my problem which is much appreciated by this tarnished silver surfer. I will now arrange to download FX4 and follow your instructions.
-
Create export-csv with dynamic (unknown amount) columns
Hi,
This is my first post, hopefully I include everything you need. My code block is at the bottom of my post.....
I have written a PS script that gives me the info I need, but I would like to format it differently. Currently I import a CSV with 2 columns - username and print queue name. The script then takes each username and looks it up in SCCM
to find the workstations the username has logged into. I then export to csv - this is where I would like to format it differently. The export csv has 4 columns username, print queue name, workstation name, and details.
username1,printqueue,workstation1,details
username1,printqueue,workstation2,details
username2,printqueue,workstation1,details
username2,printqueue,workstation2,details
My problem is that if the user logs into 5 workstations I have 5 rows with duplicated username and print queue name. If my next username logs into 8 workstations I have 8 rows, etc. I would like to format the export dynamically using as many
columns (not rows) as need. For example
username1, printqueue,workstation1,workstaion2, workstation3
username2,printqueue,workstation1,workstation2, workstation3,workstation4
I expect where I have my pscustomobject would be where I could change this - I have tried setting up a count variable and using that in my loop to be able to assign dynamic column name, I have tried using an array but still new to setting that up, maybe
I just wasn't doing it correctly. If anyone has any ideas that would be great.
Thanks, Kevin
Here is my code:
#Declare variables
$now = Get-date
$date = get-date -uformat "%Y_%m_%d_%I%M%p"
$Queues = Import-Csv "c:\Users.csv"
$SiteName="XXX"
$SCCMServer="your.sccm.server.com"
$SCCMNameSpace="root\sms\site_$SiteName"
$CSVPath1 = "c:\PrinterUsersByComputer_$date.CSV"
#Notify user that script is starting
Write-Host -ForegroundColor Green "Starting script"
#Loop through each account and find any workstations from SCCM that the user has logged into
foreach ($Queue in $Queues){
$Queue.Username
$WSs = Get-WmiObject -namespace $SCCMNameSpace -computer $SCCMServer -query "select Name from sms_r_system where LastLogonUserName = '$($queue.username)'" | Select-Object -ExpandProperty Name
#Check if the workstation variable has data
if ($WSs){
foreach ($WS in $WSs) {
#Check if workstation is ALIVE and if we have access to it to get OS version
$rtn = (Test-Connection -Cn $WS -BufferSize 16 -Count 1 -Quiet)
IF ($rtn -match 'True') {
$OS = Get-WmiObject Win32_OperatingSystem -ComputerName $WS | Select-Object -ExpandProperty Caption -ErrorAction Stop
#Write to screen device to show progress
Write-Host -ForegroundColor Green "Computer information found: $WS"
#Write to log file the username, workstation(s) logged into, and OS version
[PSCustomObject] [Ordered] @{
'UserName' = $Queue.Username
'Print Queue' = $Queue.PrintQueue
'ComputerName' = $WS
'Operating System' = $OS
} | Export-Csv $CSVpath1 -Append -NoTypeInformationOk, just a sec, I'm not sure we are on the same page. I don't think that isn't what I'm look for. Unless I'm missing something, your code above assume 4 workstation columns for every row. What if there is 5 or 8. My current output
from the full script is this (based on checking if PC is pingable, whether I'm denied the WMI query, etc)
UserName
Print Queue
ComputerName
Operating System
User1
PQ1
Computer1
Microsoft Windows 7 Enterprise
User1
PQ1
Computer2
Microsoft Windows 7 Enterprise
User1
PQ1
Computer3
Microsoft Windows 7 Enterprise
User1
PQ1
Computer4
Microsoft Windows 7 Enterprise
User1
PQ1
Computer5
Microsoft Windows 7 Enterprise
User1
PQ1
Computer6
Microsoft Windows 7 Enterprise
User1
PQ1
Computer7
Microsoft Windows 7 Enterprise
User1
PQ1
Computer8
Microsoft Windows 7 Enterprise
User1
PQ1
Computer9
Microsoft Windows 7 Enterprise
User1
PQ1
Computer10
Microsoft Windows 7 Enterprise
User1
PQ1
Computer11
Microsoft Windows 7 Enterprise
User1
PQ1
Computer12
Microsoft Windows 7 Enterprise
User1
PQ1
Computer13
No device name to query
User1
PQ1
Computer14
Microsoft Windows 7 Enterprise
User2
PQ2
Computer15
Microsoft Windows 7 Enterprise
User3
PQ3
Computer1
Microsoft Windows 7 Enterprise
User4
PQ4
Computer2
Access denied connecting to device. No access to it: Computer2
What I would really like is this, getting rid of the OS name for now:
User1
PQ1
Computer1
Computer2
Computer3
Computer4
Computer5
User2
PQ3
Computer1
User3
PQ13
Computer1
Computer2
I would just like to condense the workstations to columns instead of 1 workstation per row and be able to expand the # of columns required based on the amount of workstations in $WSs - -
How to generate a second csv file with different report columns selected?
Hi. Everybody:
How to generate a second csv file with different report columns selected?
The first csv file is easy (report attributes -> report export -> enable CSV output Yes). However, our users demand 2 csv files with different report columns selected to meet their different needs.
(The users don't want to have one csv file with all report columns included. They just want to get whatever they need directly, no extra columns)
Thank you for any help!
MZHello,
I'm doing it usually. Typically example would be in the report only the column "FIRST_NAME" and "LAST_NAME" displayed whereas
in the csv exported with the UTL_FILE the complete address (street, housenumber, additions, zip, town, state ... ) is written, these things are needed e.g. the form letters.
You do not need another page, just an additional button named e.g. "export_to_csv" on your report page.
The csv export itself is handled from a plsql procedure "stored procedure" ( I like to have business logic outside of apex) which is invoked by pressing the button "export_to_csv". Of course the stored procedure can handle also parameters
An example code would be something like
PROCEDURE srn_brief_mitglieder (
p_start_mg_nr IN NUMBER,
p_ende_mg_nr IN NUMBER
AS
export_file UTL_FILE.FILE_TYPE;
l_line VARCHAR2(20000);
l_lfd NUMBER;
l_dateiname VARCHAR2(100);
l_datum VARCHAR2(20);
l_hilfe VARCHAR2(20);
CURSOR c1 IS
SELECT
MG_NR
,TO_CHAR(MG_BEITRITT,'dd.mm.yyyy') AS MG_BEITRITT ,TO_CHAR(MG_AUFNAHME,'dd.mm.yyyy') AS MG_AUFNAHME
,MG_ANREDE ,MG_TITEL ,MG_NACHNAME ,MG_VORNAME
,MG_STRASSE ,MG_HNR ,MG_ZUSATZ ,MG_PLZ ,MG_ORT
FROM MITGLIEDER
WHERE MG_NR >= p_start_mg_nr
AND MG_NR <= p_ende_mg_nr
--WHERE ROWNUM < 10
ORDER BY MG_NR;
BEGIN
SELECT TO_CHAR(SYSDATE, 'yyyy_mm_dd' ) INTO l_datum FROM DUAL;
SELECT TO_CHAR(SYSDATE, 'hh24miss' ) INTO l_hilfe FROM DUAL;
l_datum := l_datum||'_'||l_hilfe;
--DBMS_OUTPUT.PUT_LINE ( l_datum);
l_dateiname := 'SRNBRIEF_MITGLIEDER_'||l_datum||'.CSV';
--DBMS_OUTPUT.PUT_LINE ( l_dateiname);
export_file := UTL_FILE.FOPEN('EXPORTDIR', l_dateiname, 'W');
l_line := '';
--HEADER
l_line := '"NR"|"BEITRITT"|"AUFNAHME"|"ANREDE"|"TITEL"|"NACHNAME"|"VORNAME"';
l_line := l_line||'|"STRASSE"|"HNR"|"ZUSATZ"|"PLZ"|"ORT"';
UTL_FILE.PUT_LINE(export_file, l_line);
FOR rec IN c1
LOOP
l_line := '"'||rec.MG_NR||'"';
l_line := l_line||'|"'||rec.MG_BEITRITT||'"|"' ||rec.MG_AUFNAHME||'"';
l_line := l_line||'|"'||rec.MG_ANREDE||'"|"'||rec.MG_TITEL||'"|"'||rec.MG_NACHNAME||'"|"'||rec.MG_VORNAME||'"';
l_line := l_line||'|"'||rec.MG_STRASSE||'"|"'||rec.MG_HNR||'"|"'||rec.MG_ZUSATZ||'"|"'||rec.MG_PLZ||'"|"'||rec.MG_ORT||'"';
-- DBMS_OUTPUT.PUT_LINE (l_line);
-- in datei schreiben
UTL_FILE.PUT_LINE(export_file, l_line);
END LOOP;
UTL_FILE.FCLOSE(export_file);
END srn_brief_mitglieder;Edited by: wucis on Nov 6, 2011 9:09 AM -
How to add SaveFileDialog to PowerShell Get-ADUser Export-CSV
Hi,
I am having a bit of difficulties with getting the SaveFileDialog to work when I use the Get-ADUser export-CSV.
Current code:
$handler_Output_Click=
$User = Get-Aduser $textBox1.Text -Properties DisplayName,sAMAccountName,EmailAddress,Mobile,Company,Title,Enabled,LockedOut,Description,Created,Modified,LastLogonDate,AccountExpirationDate,AccountLockoutTime,BadLogonCount,CannotChangePassword,LastBadPasswordAttempt,PasswordLastSet,PasswordExpired,LogonWorkstations,CanonicalName | Select DisplayName,sAMAccountName,EmailAddress,Mobile,Company,Title,Enabled,LockedOut,Description,Created,Modified,LastLogonDate,AccountExpirationDate,AccountLockoutTime,BadLogonCount,CannotChangePassword,LastBadPasswordAttempt,PasswordLastSet,PasswordExpired,LogonWorkstations,CanonicalName | Export-CSV C:\temp\test.csv -NoTypeInformation ';' -encoding utf8
$richTextBox1.Text = "A file 'test.csv' has been created to C:\temp\ based on the user: $($textBox1.Text)"
Here a specific filename is already defined and I have to edit the code each time I want a different filename.
It would be perfect if I could implement the SaveFileDialog box so I have the ability to name the file before saving and possibly even have the option to select the file type (among .CSV and All files).
This it the export/output button itself:
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 502
$System_Drawing_Point.Y = 38
$Output.Location = $System_Drawing_Point
$Output.Name = "Output"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 23
$System_Drawing_Size.Width = 85
$Output.Size = $System_Drawing_Size
$Output.TabIndex = 2
$Output.Text = "Export as file"
$Output.UseVisualStyleBackColor = $True
$Output.add_Click($handler_Output_Click)
# $form1.AcceptButton = $Output
$Output.DataBindings.DefaultDataSourceUpdateMode = 0
$form1.Controls.Add($Output)
And in the beginning of my script I also have defined the following:
[System.Windows.Forms.Application]::EnableVisualStyles();
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Windows.Forms.SaveFileDialog") | Out-Null
And also:
$Output = New-Object System.Windows.Forms.Button
Any ideas how can I implement the SaveFileDialog so when I press the "Export as file" button the PowerShell command "Get-Aduser $textBox1.Text -Properties DisplayName,sAMAc..." is ran and I can choose the file name from a pop-up
dialog box where to save the file and also put a filename? Currently I have to edit the code in order to assign a new file name (or go rename the file from that location).
Thank you in advance,
Henri
EDIT:
I know that the below is the answer to the SaveFileDialog, however I cannot imagine how I could implement it to my script into the "Get-Aduser $textBox1.Text -Properties a,b,c,d | select a,b,c,d | Export-CSV C:\temp\test.csv" cmdlet.
Function Get-SaveFile($initialDirectory)
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") |
Out-Null
$SaveFileDialog = New-Object System.Windows.Forms.SaveFileDialog
$SaveFileDialog.initialDirectory = $initialDirectory
$SaveFileDialog.filter = "All files (*.*)| *.*"
$SaveFileDialog.ShowDialog() | Out-Null
$SaveFileDialog.filenameJust run the dialog before exporting the file. Why is that a problem?
\_(ツ)_/
It works now! I made some modifications and it works. Thank you very much for the advice.
$handler_Output_Click={
Add-Type -AssemblyName System.Windows.Forms
$SaveAs1 = New-Object System.Windows.Forms.SaveFileDialog
$SaveAs1.Filter = "CSV Files (*.csv)|*.csv|Text Files (*.txt)|*.txt|Excel Worksheet (*.xls)|*.xls|All Files (*.*)|*.*"
$SaveAs1.SupportMultiDottedExtensions = $true;
$SaveAs1.InitialDirectory = "C:\temp\"
if($SaveAs1.ShowDialog() -eq 'Ok'){
$User = Get-Aduser $textBox1.Text -Properties DisplayName,sAMAccountName,EmailAddress,Mobile,Company,Title,Enabled,LockedOut,Description,Created,Modified,LastLogonDate,AccountExpirationDate,AccountLockoutTime,BadLogonCount,CannotChangePassword,LastBadPasswordAttempt,PasswordLastSet,PasswordExpired,LogonWorkstations,CanonicalName | Select DisplayName,sAMAccountName,EmailAddress,Mobile,Company,Title,Enabled,LockedOut,Description,Created,Modified,LastLogonDate,AccountExpirationDate,AccountLockoutTime,BadLogonCount,CannotChangePassword,LastBadPasswordAttempt,PasswordLastSet,PasswordExpired,LogonWorkstations,CanonicalName | Export-CSV $($SaveAs1.filename) -NoTypeInformation ';' -Encoding UTF8
$richTextBox1.Text = "A file $($SaveAs1.filename) has been created based on the user: $($textBox1.Text)" -
Get-Mailbox PS command import/export csv - need help
Greetings,
I know this should be simple but I'm having trouble. I have about 500 users that have left the company and I want to verify their Exchange 2010 mailbox have been disabled. If I just run the basic command "Get-Mailbox -identity alias"
I see all I need to see. The Name, Alias, and ServerName (that their mailbox is on). If I check someone whose mailbox has been disabled I get "object could not be found." Perfect, then I know their mailbox no longer exists.
In trying to import a csv file of the 500 users - and export it I'm having trouble. There are a few posts on these forums for similar issues but none are working or the conditions are different. I'm not too good and PS scripting so I am hoping someone
can assist. I pieced this together.
import-csv C:\temp\DisabledMBs.csv | get-mailbox >c:\temp\DisabledMBsOutput.csv
The csv output file is blank. The PS screen outputs this error for each user.
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
+ CategoryInfo : InvalidArgument: (@{Name=Heaton; ...er Logon Name=}:PSObject) [Get-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Get-Mailbox
I guess I'm missing something here but stuck. Any help is greatly appreciated!
thank you!If you use a CSV for input, you need to tell the Get-Mailbox command what field is the identifier. So if you have an alias field in your CSV, you would run your command as follows:
import-csv C:\temp\DisabledMBs.csv | % { get-mailbox $_.Alias } | Export-Csv c:\temp\DisabledMBsOutput.csv -NoTypeInformation
BTW, you'll notice that I've also piped your output to the Export-Csv command. If you just pipe the output of Get-Mailbox to a file with a CSV suffix, you don't get a CSV - you get a text file with only one field named "Name
Alias ServerName ProhibitSendQuota" (note, not "Name", "Alias", "ServerName", and "ProhibitSendQuota"
separately). -
How do you do a quick transfer of data from one TX to another TX with different user name
I have more than one TX and want to keep most of the information, addresses, media, calendar as well as third party software the same on all my TX's. Is there a way to do this without the long hassle of exporting all that can be exported, and then importing it into each TX. Then adding all the third party software again? I have a new TX and remember how long this takes, so I am hoping for a faster method. I already know how to do a transfer if using the same user name, but this won't work when each will have a different user name in order to hotsync.
This may be a different question. All the TXs will be used and will sync to the same computer via USB, and all are on the Palm Desktop. I want to use them interchangeably. I would also like to keep the information current on all of them, as I now must copy paste any new info (ex. new address) into each via either palm desktop, or beaming to the others. Often this leads to discrepancies of the data between the different TXs.
Post relates to: Palm TX
Message Edited by Silfox on 06-22-2009 09:03 AMYou might look into a program called "SyncUs" from an author in the UK. It will keep all the PIM data synced between two Palm OS units.
WyreNut
I am a Volunteer here, not employed by HP.
You too can become an HP Expert! Details HERE!
If my post has helped you, click the Kudos Thumbs up!
If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked! -
Export-csv output maximum row size
Hi all. May I know the maximum row size that can output to .csv using 'export-csv'??
There's no limit on writing to a CSV file.
You can try:
# max rows to export to CSV:
$i=0
While ($true) { #Forever
$i++
$i
"Some text" | Export-Csv -Path .\test12.csv -Append -NoTypeInformation
until you run out of disk space, which may take a while. A million lines using the above script makes a 5 BM file..
Now reading it back is an entirely different story. Try
Delimit..
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) -
How to export csv without doublequote
I ran the following comand
ls |export-csv "d:\a.csv"
The result is like the following, every field is double quoted, is there any way to not export double quote. Currently the silly approach I used is to first export-csv, and then read the file in and replace all the double quote with empty string.
#TYPE System.IO.DirectoryInfo
"PSPath","PSParentPath","PSChildName","PSDrive","PSProvider","PSIsContainer","BaseName","Mode","Name","Parent","Exists","Root","FullName","Extension","CreationTime","CreationTimeUtc","LastAccessTime","LastAccessTimeUtc","LastWriteTime","LastWriteTimeUtc","Attributes"
"Microsoft.PowerShell.Core\FileSystem::C:\Users\Daniel.Wu\.fcm","Microsoft.PowerShell.Core\FileSystem::C:\Users\Daniel.Wu",".fcm","C","Microsoft.PowerShell.Core\FileSystem","True",".fcm","d----",".fcm","Daniel.Wu","True","C:\","C:\Users\Daniel.Wu\.fcm",".fcm","10/6/2010
10:33:39 AM","10/6/2010 2:33:39 AM","10/15/2010 3:28:57 PM","10/15/2010 7:28:57 AM","10/15/2010 3:28:57 PM","10/15/2010 7:28:57 AM","Directory"This really is a typical "Microsofty" reply. Yes, it's good practice to quote strings that may contain special characters or even commas within the fields. But if you know your data and you also know that there will be no such issues, then it's
completely unnecessary.
There is no formalised standard for CSV yet. RFC 4180 is a proposed standard, and even it says that strings
may be quoted. The exception is for strings that actually contain commas.
What gets up my nose is when MS fail to present a reasonable option (e.g. a "-noquote" switch), and then attempt to justify it by saying it
should be the standard.
CSV is a flexible format, and I should be able to output as TSV (which I can, thanks, Microsoft) and refrain from quoting my data as I see fit. Yes, I can roll my own using Add-Content, but when you have something like Export-CSV that implies it'll support
the usual options (no quotes unless specified), it's frustrating.
If you feel that strongly, add a suggestion on Connect. That stands a much better chance of being seen by someone who might be able to implement your suggestion than randomly complaining in an old, answered thread.
https://connect.microsoft.com/
EDIT: I just re-read my post and I want to clarify that I'm not trying to be argumentative with this suggestion.
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing) -
Oracle 10g Data Dump---Import to different users
Hi everybody,
I exported data in oracle 10g using expdp in user schema(abc1).
Now i want to import that data in different user schema (abc2) and another user schema (abc3). Both schemas (abc2 and abc3) are in same tablespace.
How to do this. Shall i need to export that data in SYSTEM mode to import for different users..?
Thanks in advance
PalShall i need to export that data in SYSTEM mode to import for different users..?No need. You can use REMAP_SCHEMA option on import, e.g.
impdp system/<password> directory=<directory> dumpfile=<dumpfile> remap_schema=abc1:abc2
See http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_import.htm#sthref339 -
VBA inserting form fields, different positions result for different users.
I'm certianly at a loss for wrapping my head around this.
Adobe Acrobat 9 Standard (v 9.5.4)
Excel 2010 (VBA)
The problem: When I create the PDF document from Excel, I search for a string of text in order to capture the Quads for the containing rectangle. Then I use the quads to insert a control with numeric offsets. The problem that I am facing is that the offsets seem to be causing the controls to be in different locations for different users. For example, when I send (-26, -2, 100, 10) {x-offset, y-offset, width, height}; the control aligns exactly where I want it. But when another user user runs the exact same routine, or opens the PDF that I created, the fields are no longer positioned correctly.
Is there some setting that I am missing? EDIT, SOLVED: My Acrobat had a custom point to pixel setting. (Preferences > Page Display > Resolution)
Private Function makePdfControl(ByVal pdfPage As Integer, keyTerm As String, Optional ByVal keyTermLookAhead As Integer = 0, Optional ctrlType As String = "text", Optional cCoords As Variant = 0)
'pdfPage is the target page of the document
'keyTerm is the assembled search term: "Date Shipped >> DATESHIPPED"
'keyTermLookAhead is the number of words assembed into KeyTerm, zero based: "Date Shipped" >> "DATESHIPPED" >> "DATE" = 0, "SHIPPED" = 1
'ctrlType determines the type of control to place on the form; default is text
'cCoords carries an array of integers: x-offset, y-offset, width, and height
txt = ""
Dim fkt As Integer 'counter for keyTermLookAhead
Dim matchFound As Boolean 'flag that a match has been found
Dim maxWords As Integer 'the maximum number of words in pdfPage
Dim coord(3) As Integer 'local array container to provide interface for cCoords
p = 0
matchFound = False
maxWords = jso.getPageNumWords(pdfPage)
Do While p + keyTermLookAhead <= maxWords 'search all words in the target page; break if not found
p = p + 1
For fkt = 0 To keyTermLookAhead
txt = txt & jso.getPageNthWord(pdfPage, p + fkt)
Next fkt
If UCase(txt) <> UCase(keyTerm) Then 'the assembly of terms is complete, check if match
txt = "" 'prepare "txt" for next assembly
matchFound = False
Else
matchFound = True 'we've struck gold, exit the loop preserving val of "p" as the first word in the assembly
Exit Do
End If
Loop
If matchFound = True Then
Dim qtmp() As Variant
Dim q(7) As Double
qtmp = jso.getPageNthWordQuads(pdfPage, p)(0) 'collect the rectangle containing the first word of the search; output is a base-0x7 array
For a = 0 To 7
q(a) = qtmp(a) 'collect the data
Next a
If VarType(cCoords) <> 8204 Then '8204 means that we've inserted an array into the Varient type var cCoords
coord(0) = 0
coord(1) = 0
coord(2) = 100
coord(3) = 15
Else
coord(0) = cCoords(0) 'x-offset value
coord(1) = cCoords(1) 'y-offset value
coord(2) = cCoords(2) 'width value
coord(3) = cCoords(3) 'height value
End If
x0 = coord(0) 'x-offset var
y0 = coord(1) 'y-offset var
w = coord(2) 'ctrl width
h = coord(3) 'ctrl height
x = q(0) + x0
y = q(7) - h + y0
'origin point of doc matrix is lower-left corner
'origin point of control is lower left corner of the rectangle containing the first word of the search phrase
'offsets are placed from this point, negative x shifts to the left, negative y shifts down
'values are in points, not pixels
Set f = aForm.Fields.Add(keyTerm, ctrlType, pdfPage, x, y, x + w, y + h) '(uplf, lwlf, lwrt, uprt) 'add the control to the form using values passed in
End If
End Function
The above function is used while looping through the pages of the created PDF document. I am using the following function to create the document from Excel:
Private Sub exportToPDF()
DoEvents
Application.ScreenUpdating = False
Call showTabs(False)
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=pdfPathData, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Call showTabs(True)
Call locateDoc
Application.ScreenUpdating = True
End Sub
Message was edited by: ilivingston: solvedThanks for the reply, I did spend some time working on this issue... here is what I found...
1) First of all, I did have a custom Points to Inches setting in my Acrobat options... 110 vs 96. Resetting this allowed for me to see the alignment issue that my colleagues were referencing first hand.
As it turned out, my results were better, but still had inconsistency among different workstations. Leading me to..
2) The MSFT creator uses the default printer in some way to create the PDF. Because the different workstations were using different printers, we were getting different results. If everyone used an HP 1320, nobody would see any difference upon creating / adding fields.
The final solution was to change the Application.Printer to a common network printer before the export operation, and return the Application.Printer to the user default after the export completed. This has provided us with a common ground to work upon; we are lucky to have a network printer that can be used for this purpose, as I can see this becoming non-viable in environments where this would be unavailable. -
Can anyone point me in the right direction
- allow user to export a table/recordset in a csv format
(Word label
Merge for labels)
- asp vbscript hosting
- js enabledTom Muck has an export csv routine that works in ASP. You
might want to
check out the exchange for it.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Philo" <[email protected]> wrote in message
news:etsac2$eml$[email protected]..
> Can anyone point me in the right direction
>
> - allow user to export a table/recordset in a csv format
(Word label
> Merge for labels)
> - asp vbscript hosting
> - js enabled
>
> --
> -
I want to share address books between different users on same PC
Hi
We have a PC with two different Users but there is one email address shared between them. We have a copy of Thunderbird installed one each User and one User has multiple accounts for privacy reasons. It would be really helpful to have a shared addressbook in common to access addresses from. Is this possible?
Cheers, MarcusMarcus,
Nothing really easy comes to mind, but here are two ideas to consider, depending on how frequently the address book changes:
1) If the shared email address happens to be gmail, then each user can install the gContactSync add-on and let Google have the master copy. This would give each of you frequent synchronizations to the same address book.
2) An easy, but not automatic approach would be for one user to be in charge of changes and periodically (daily, weekly, ...) export the address book to an ldif file. The other user then could import the address book to his/her TB account.
- duggabe -
Trying to EXPORT-CSV without headers - Tried suggestions in forum - still stuck
I am tryling to get the contents of my array out to a CSV with no neader records. I looked for examples here and on other sites but I still cannot get it working.
Below is the latest attempt and the 1st row of te output. I end up with a CSV with the corect records and no headers, but with a single column of data. Note below that the first element in the row is un-quoted, but each element after is enclosed
in quotes.
I feel like I am close, but need help to get there.
Thanks
-- CODE --
$NormalBatch |
Select "Rec_Type","PO","Customer","Invoice","Ship","Date","B1","Name","Addr1","Addr2","City","State","Zip","Country","Line","Qty","Unit","Site","Carton"
|
ConvertTo-Csv |
Select -Skip 2 |
Out-File "c:\users\user\desktop\todo\normalbatch.csv"
-- RESULT --
INVOICE,"123456789","VENDOR.COM","4013596","UPSG-Ground","12/1/2014","","NORM AVERAGE","123 MAIN ST.","","YOUR TOWN","HI","1235","","","","","",""Hi Tom,
If you want to remove header from csv file, please refer to the script below which will export processes without header:
$i="d:\output.csv"
$o="d:\test.csv"
get-process|select name, id|Export-Csv $i
Import-Csv $i |select name,id | Export-Csv -path $o -NoTypeInformation
(Get-Content $o | Select-Object -Skip 1) | Set-Content $o
If there is anything else regarding this issue, please feel free to post back.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang
TechNet Community Support
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]
Maybe you are looking for
-
Hi, I need to restore my Macbook Pro from my Time Machine backup as I cannot boot (gets stuck on the Apple screen with the wheel spinning and Disk Verify and Repair both fail). My questions is......if I do that will my bootcamp partition, which works
-
Make IBAN field necessary for vendor master
Hi SAP gurus, is there any way to make IBAN field in bank details necessary for vendor master? I have tryed with SAPMF02K - EXIT_SAPMF02K_001 but there isn' t a iban filed. thx in advances V. Moderator: Double-post
-
Why my itunes gift card said not activeted
my itunes gift card doesn't work
-
Error message when setting up MySql
I have created a database using MySQL 4/5 as the driver. I am getting an error saying this: Connection verification failed for data source pankledb. java.sql.SQLException: Access denied for user"@'localhost' (using password: NO) The root cause was th
-
Hi, I just created one PR (ZVPR) and two PO ( ZVPO, ZBPO) , My requirement is Based on ZVPR I can create PO on ZVPR PO Doc only not ZBPO Doc.. In SPRO Where Exactly I can make the settings.. Please Guide Me. Rgs, Priya.