Using Powershell Script Run simple query in MS Access 2007 and export the results of query to Excel
Hi Experts,
I have a Access 2007 DB file and 2 Big tables inside that (bigger than the size that can be easily handled by MS Excel 2007).
My requirement is automate using powershell scripts the below things.
1. Create a SQL query in Access DB and save that in access DB
2. Run the saved query and export the result in excel sheet where I can create the charts and Pivots. Thanks in advance
Prajesh
Do you have to use the Access query, couldn't you just recreate the query in Powershell? Here's a link with good info that references an existing script for querying an Access database:
http://blogs.technet.com/b/heyscriptingguy/archive/2009/08/13/hey-scripting-guy-can-i-query-a-microsoft-access-database-with-a-windows-powershell-script.aspx
Once you have your dataset you can pipe it to
Export-Csv -NoType c:\pathtofile\output.csv
Similar Messages
-
Using a mac's wireless card as an access point and hiding the SSID
Is it possible to create a wireless network on a mac that my iphone and laptop can connect to, and hide the ssid for the network and add wep protection? I really need to know how to do this.
Welcome to Apple's discussion forums!
Hiding the SSID doesn't necessarily make your network any more secure, especially if you're only using WEP. From what I understand, the SSID is broadcasted every time a computer makes a connection anyway, so hiding it really doesn't accomplish anything that can't be outsmarted by some simple SSID interception software. You really need to be using WPA2 or at least WPA in order to get a reasonable level of security.
Your Mac can only host with WEP-based security. That's acceptable for small file transfers between Macs on a temporary basis, but if you want to have a home network with some real security, you either need to buy a wireless router with WPA2 or use Ethernet. Ethernet is preferable. -
How to Compare 2 CSV file and store the result to 3rd csv file using PowerShell script?
I want to do the below task using powershell script only.
I have 2 csv files and I want to compare those two files and I want to store the comparision result to 3rd csv file. Please look at the follwingsnap:
This image is csv file only.
Could you please any one help me.
Thanks in advance.
By
A Path finder
JoSwa
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"
Best Online JournalNot certain this is what you're after, but this :
#import the contents of both csv files
$dbexcel=import-csv c:\dbexcel.csv
$liveexcel=import-csv C:\liveexcel.csv
#prepare the output csv and create the headers
$outputexcel="c:\outputexcel.csv"
$outputline="Name,Connection Status,Version,DbExcel,LiveExcel"
$outputline | out-file $outputexcel
#Loop through each record based on the number of records (assuming equal number in both files)
for ($i=0; $i -le $dbexcel.Length-1;$i++)
# Assign the yes / null values to equal the word equivalent
if ($dbexcel.isavail[$i] -eq "yes") {$dbavail="Available"} else {$dbavail="Unavailable"}
if ($liveexcel.isavail[$i] -eq "yes") {$liveavail="Available"} else {$liveavail="Unavailable"}
#create the live of csv content from the two input csv files
$outputline=$dbexcel.name[$i] + "," + $liveexcel.'connection status'[$i] + "," + $dbexcel.version[$i] + "," + $dbavail + "," + $liveavail
#output that line to the csv file
$outputline | out-file $outputexcel -Append
should do what you're looking for, or give you enough to edit it to your exact need.
I've assumed that the dbexcel.csv and liveexcel.csv files live in the root of c:\ for this, that they include the header information, and that the outputexcel.csv file will be saved to the same place (including headers). -
How to set volume using Powershell script?
I would like to know on how to set volume under Window 7 Home 64 bits system using Powershell script.
Such as 8000 levels as default
Does anyone have any suggestions?
Thanks in advance for any suggestions
Thanks in advance for any suggestionsTry this.
Function Set-SpeakerVolume{
Param (
[switch]$min,
[switch]$max,
[int]$Percent
$wshShell = new-object -com wscript.shell
If ($min){
1..50 | % {$wshShell.SendKeys([char]174)}
ElseIf ($max){
1..50 | % {$wshShell.SendKeys([char]175)}
elseif($Percent){
1..50 | % {$wshShell.SendKeys([char]174)}
1..($Percent/2) |% {$wshShell.SendKeys([char]175)}
Else{
$wshShell.SendKeys([char]173)
This works in Windows 8.1.
Stolen / Modified from
http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/28/weekend-scripter-cheesy-script-to-set-speaker-volume.aspx, which took me 20 seconds of (apparently) lucky searching.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}}) -
Is it possible to monitor State change of a .CSV file using powershell scripting ?
Hi All,
I just would like to know Is it possible to monitor State change of a .CSV file using powershell scripting ? We have SCOM tool which has that capability but there are some drawbacks in that for which we are not able to utilise that. So i would like
to know is this possible using powershell.
So if there is any number above 303 in the .CSV file then i need a email alert / notification for the same.
Gautam.75801Hi Jrv,
Thank you very much. I modified the above and it worked.
Import-Csv C:\SCOM_Tasks\GCC2010Capacitymanagement\CapacityMgntData.csv | ?{$_.Mailboxes -gt 303} | Export-csv -path C:\SCOM_Tasks\Mbx_Above303.csv;
Send-MailMessage -Attachments "C:\SCOM_Tasks\Mbx_Above303.csv" -To “[email protected]" -From “abc@xyz" -SMTPServer [email protected] -Subject “Mailboxex are above 303 in Exchange databases” -Body “Mailboxex are above 303 in Exchange databases"
Mailboxex - is the line which i want to monitor if the values there are above 303. And it will extract the lines with all above 303 to another CSV file and 2nd is a mail script to email me the same with the attachment of the 2nd extract.
Gautam.75801 -
I need help to do this using powershell scripts on Windows 8.1?
OS : Windows 8.1 Enterprise
TPM Chip : None
Enabling bitlocker on OS drive with a password at boot time is a 2 step process.
1) Edit the Group Policy (gpedit.msc) - Administrative Templates -> Windows Components -> BitLocker Drive Encryption -> Operating System Drives ->
Require additional authentication at startup -> Allow bitlocker without a compatible TPM
ref : http://www.7tutorials.com/how-enable-bitlocker-without-tpm-chip-windows-7-windows-8
2) Enable Bitlocker on c driver using manage bitlocker snapin
I need help to do this using powershell scripts?
I researched on the forums but ran into an issue.
I found that Group policy commandlets can be used to do step 1.
I am getting the error : "ins have been registered for Windows PowerShell version 4" when I try to do the following in windows 8.1
Add-PSSnapin GroupPolicy
Import-Module GroupPolicy -VerboseHi TinkerBotFoo,
I’m writing to just check in to see if the suggestions were helpful. If you need further help,
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
TechNet Community Support
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
How to publish infopath form using powershell script in infopath 2010?
Is any approach for such solution.Hi,
Try below command:
Uninstall the existing solution (based on the from file name):
Uninstall-SPInfoPathFormTemplate -Identity Exampleform.xsn
Install the new solution (based on the from file name):
Install-SPInfoPathFormTemplate -Path C:\Form.xsn
Disable feature on site collection level
Disable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site http://SPSite
Enable feature on site collection level
Enable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site "http://SPSite"
See this blogs for your ref:
http://rgielen.blogspot.in/2010/11/deploy-infopath-2010-forms-with.html
http://mysharepointwork.blogspot.in/2010/09/deploy-infopath-forms-with-powershell.html
Hope it could help
Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer -
Get the daily incremental search crawl information using PowerShell script
Dear Friends ,
I want to get the daily incremental search crawl information using PowerShell script . I need this information into CSV or txt format . Can you please help me with this.
valmikiHi
I have got the below script which worked .
## SharePoint Reference
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
function global:Get-CrawlHistory($url)
trap [Exception] {
write-error $("ERROR: " + $_.Exception.GetType().FullName);
write-error $("ERROR: " + $_.Exception.Message);
continue;
$s =
new-Object Microsoft.SharePoint.SPSite($url);
$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);
$h =
new-Object Microsoft.Office.Server.Search.Administration.CrawlHistory($c);
Write-OutPut $h.GetCrawlHistory();
$s.Dispose();
Get-CrawlHistory
-url http://your_site_url/
|
Export-CsvF:\temp\search.csv
valmiki -
My G Drive will not show up on my desktop for use. It did yesterday. It is not full and currently the light turns on and seems to be running but will not show up on my desktop. What can I do?
1. verify on another Mac first. and another port.
2. very likely dead SATA card
read about it here:
Your dead external hard drive is likely fine! Great hope for your 'faulty' external HD -
Hey Scripting Guys,
I have been in and out of Powershell last few years, not that great at it tbh !!! I'm looking for advice on how I can as in Title, Create a Powershell script to Scan Active Directory Attributes for Country and Department ,Then add to Group then add to Distribution
list based on Region/Country
I was thinking along the lines of get-aduser -LDAPFilter "(department=SALES France) and adding a where clause for country.
Any help would be great.
DecSo I have tried a few variations but get errors on both
get-aduser -LDAPFilter "(&(department=SALES)(c=us))" | Add-ADPrincipalGroupMembership -MemberOf "testgroup"
get-aduser -LDAPFilter "(&(department=SALES)(c=fr))" | Add-ADGroupMember -identity "testgroup"
Add-ADPrincipalGroupMembership : Object reference not set to an instance of an
object.
At line:1 char:86
+ get-aduser -LDAPFilter "(&(department=SALES)(c=fr))" | Add-ADPrincipalGroupMe
mbership <<<< -MemberOf "testgroup"
+ CategoryInfo : NotSpecified: (:) [Add-ADPrincipalGroupMembershi
p], NullReferenceException
+ FullyQualifiedErrorId : Object reference not set to an instance of an ob
ject.,Microsoft.ActiveDirectory.Management.Commands.AddADPrincipalGroupMem
bership -
Convert this query to ABAP and display the results
Hi Everyone,
I have a sql query in native sql (oracle). I want execute it in ABAP editor and display the results.
I need to get this to an internal table and display the results. How do i write the script any help will be great use to me.
Here is the query:
<i> select (select decode(extent_management,'LOCAL','*',' ') ||
decode(segment_space_management,'AUTO','a ','m ')
from dba_tablespaces where tablespace_name = b.tablespace_name) || nvl(b.tablespace_name,
nvl(a.tablespace_name,'UNKOWN')) name,
kbytes_alloc kbytes,
kbytes_alloc-nvl(kbytes_free,0) used,
nvl(kbytes_free,0) free,
((kbytes_alloc-nvl(kbytes_free,0))/
kbytes_alloc)*100 pct_used,
nvl(largest,0) largest,
nvl(kbytes_max,kbytes_alloc) Max_Size,
decode( kbytes_max, 0, 0, (kbytes_alloc/kbytes_max)*100) pct_max_used from ( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name ) a,
( select sum(bytes)/1024 Kbytes_alloc,
sum(maxbytes)/1024 Kbytes_max,
tablespace_name
from sys.dba_data_files
group by tablespace_name
union all
select sum(bytes)/1024 Kbytes_alloc,
sum(maxbytes)/1024 Kbytes_max,
tablespace_name
from sys.dba_temp_files
group by tablespace_name )b
where a.tablespace_name = b.tablespace_name order by 1;
</i>
Thanks,
Prashant.Hi Prashant,
Native SQL commands in ABAP are placed between EXEC SQL and ENDEXEC. You can place all your statements in between these EXEC SQL and ENDEXEC in a report.
EXEC SQL [PERFORMING <form>].
<Native SQL statement>
ENDEXEC.
Check this link to know about Native SQL
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/frameset.htm
Thanks,
Vinay -
I copied a lot of photos from an iphone to a DVD using a Windows 7 laptop, now I cannot access those photos on the DVD. HELP! In Windows Exlporer I can see the data on the disk in the details but when I click on it nothing appears as if there is nothing on it.
It should. So they aren't shown in the Last Import smart album, right? Try the following:
1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
2 - Run Option #4, Rebuild Database, followed by Option #1 if needed.
OT -
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"></tr><tr><td height="1" style="font-size: 1pt"></td></tr></tbody></table><blockquote><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"><td id="HB_Focus_Element" width="100%" height="250" valign="top"><p>I initiate a CR XI from a C++ routine using ShellExecute command, the report file is opened and the C++ program continues to execute, this is working fine, now I need the following two things:</p><p>1. When the report is invoked I would like it to run and print the result either to a printer or to a file.</p><p>2. I need to send the report parameters since it will not prompt for it if it runs automatically.</p><p>Thanks in advance for your help.</p></td></tr><tr></tr></tbody></table><blockquote><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"><td id="HB_Focus_Element" width="100%" height="250" valign="top"><p> </p></td></tr></tbody></table></blockquote></blockquote>
Please re-post if this is still an issue to the Legacy Application Development SDKs Forum or purchase a case and have a dedicated support engineer work with you directly
-
Hi All,
I am getting an error message "All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054" when trying to log into HRC (This user has the reporting capabilities) . I checked the log files this is what i found out
The log file stated that there were ongoing connections of HRC with the CCX (I am sure there isn't any active login to HRC)
|| When you tried to login the following error was being displayed because the maximum number of connections were reached for the server . We can see that a total number of 5 connections have been configured . ||
1: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Current number of connections (5) from historical Clients/Scheduler to 'CRA_DATABASE' database exceeded the maximum number of possible connections (5).Check with your administrator about changing this limit on server (wfengine.properties), however this might impact server performance.
|| Below we can see all 5 connections being used up . ||
2: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:[DB Connections From Clients (count=5)]|[(#1) 'username'='uccxhrc','hostname'='3SK5FS1.ucsfmedicalcenter.org']|[(#2) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#3) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#4) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#5) 'username'='uccxhrc','hostname'='47BMMM1.ucsfmedicalcenter.org']
|| Once the maximum number of connection was reached it threw an error . ||
3: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Number of max connection to 'CRA_DATABASE' database was reached! Connection could not be established.
4: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Database connection to 'CRA_DATABASE' failed due to (All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054.)
Current exact UCCX Version 9.0.2.11001-24
Current CUCM Version 8.6.2.23900-10
Business impact Not Critical
Exact error message All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054
What is the OS version of the PC you are running and is it physical machine or virtual machine that is running the HRC client ..
OS Version Windows 7 Home Premium 64 bit and it’s a physical machine.
. The Max DB Connections for Report Client Sessions is set to 5 for each servers (There are two servers). The no of HR Sessions is set to 10.
I wanted to know if there is a way to find the HRC sessions active now and terminate the one or more or all of that sessions from the server end ?We have had this "PRX5" problem with Exchange 2013 since the RTM version. We recently applied CU3, and it did not correct the problem. We have seen this problem on every Exchange 2013 we manage. They are all installations where all roles
are installed on the same Windows server, and in our case, they are all Windows virtual machines using Windows 2012 Hyper-V.
We have tried all the "this fixed it for me" solutions regarding DNS, network cards, host file entries and so forth. None of those "solutions" made any difference whatsoever. The occurrence of the temporary error PRX5 seems totally random.
About 2 out of 20 incoming mail test by Microsoft Connectivity Analyzer fail with this PRX5 error.
Most people don't ever notice the issue because remote mail servers retry the connection later. However, telephone voice mail systems that forward voice message files to email, or other such applications such as your scanner, often don't retry and
simply fail. Our phone system actually disables all further attempts to send voice mail to a particular user if the PRX5 error is returned when the email is sent by the phone system.
Is Microsoft totally oblivious to this problem?
PRX5 is a serious issue that needs an Exchange team resolution, or at least an acknowledgement that the problem actually does exist and has negative consequences for proper mail flow.
JSB -
The 2012 Mac Mini's are listed on this article. Can I run windows 7 64-bit on it and/or the 32-bit?
I would buy nothing less than Windows 7 64-bit Pro.
32-bit only addresses 3.5 GB RAM ... 2012 Macminis can hold 16 GB.
64-bit Home addresses 16 GB RAM.
64-bit Pro addresses 192 GB RAM and han an XP mode.
This is all about having a good version of Windows for future use. Yu can buy "Syem Builder" version of 64-bit Pro for $140.
Maybe you are looking for
-
Submit to SAP button missing in adobe
Hi Experts, I am facing a problem while trying to design an interactive form. I am not able to find the "Submit to SAP" button and "webdynpro" tab in Libraries. plz help me to solve this. John
-
I want to report a bug in 1.A0 BIOS
pci vga doesnt work with it just at startup send a video signal with black full screen and freze Neo4-f
-
G++ / JNI / dependencies
Hi, I'm trying to build a jni library on SPARC Solaris 8 using g++. The library works just fine, however I appear to have to have libgcc installed on the machines where I want to use the library. I'm building the library with the following command li
-
Will Radeon x800xt support 30" ACD plus a 23"ACD
I have a dual 2ghz G5 tower with an ATI Radeon x800xt graphics card. Will the system support two Apple Cinema Displays simultaneously: a 30" plus a 23""?
-
Transparent Film effect ?
Hello Forum, I need to create a transparent screen protector kind of effect in Photoshop. Pls check the attachment for the effect. I will be greatful if anybody can suggest any tutorials or photoshop filters which can achieve this or a similar kind o