Scan a Excel file via power Shell

Hi;
I have in input a Excel File (3 colunms) to create automatically the sites collections (CS) and thier sites (SITES) :
INUPUT :
DECC    CS       SITES
dec1    paris     site1
dec1    paris     site2
dec1    paris     site3
dec1    nice      site1
dec1    nice      site2
dec1    nimes   site1
dec2   ales       site1
dec2   ales       site2
dec2   sete       site1
etc...
How scan the Excel file via power shell to create the sites + collections in reading like this :
dec 1 -- paris
                     -- site1 & site2 & site3
         --  nice
                     -- site1 & site 2
         -- nimes
                    -- site1
dec 2 -- ales
                  -- site1 & site2
         -- sete
                  -- site1
Regards;

Hello soussou97,
My approach is to save the values of your first and second column (the columns you want to sort your values with) in ArrayLists and then use dynamic variables to save the actual content. Look at the following code. It should be able to display the information
you need. 
#Specify the path of the excel file
$FilePath = 'Path\file.xlsx'
#Specify the Sheet name
$SheetName = "Sheet"
# Create an Object Excel.Application using Com interface
$objExcel = New-Object -ComObject Excel.Application
# Disable the 'visible' property so the document won't open in excel
$objExcel.Visible = $false
# Open the Excel file and save it in $WorkBook
$WorkBook = $objExcel.Workbooks.Open($FilePath)
# Load the WorkSheet 'BuildSpecs'
$WorkSheet = $objExcel.sheets.item($SheetName)
# I am taking row count as 2, because the first row in my case is header
$intRow = 2
[System.Collections.ArrayList]$farr = @()
[System.Collections.ArrayList]$sarr = @()
Do {
# Reading the first column of the current row
$First = $WorkSheet.Cells.Item($intRow, 1).Value()
# Reading the second column of the current row
$Second = $WorkSheet.Cells.Item($intRow, 2).Value()
# Reading the third column of the current row
$Third = $WorkSheet.Cells.Item($intRow, 3).Value()
"First: " + $First
"Second: " + $Second
"Third :" + $Third
if($farr -notcontains $First){
$farr.Add($First)
if($sarr -notcontains $Second){
$sarr.Add($Second)
$variable = Get-Variable -Name "$First-$Second" -Scope Global -ErrorAction SilentlyContinue
if ($variable -eq $null)
Write-Host "$First-$Second does not exist"
New-Variable -Name "$First-$Second" -Value $Third
else{
$val = Get-Variable -Name "$First-$Second" -ValueOnly
Set-Variable -Name "$First-$Second" -Value $val","$Third
$intRow++
}While ($WorkSheet.Cells.Item($intRow,1).Value() -ne $null)
foreach($dec in $farr){
foreach($city in $sarr){
$variable = Get-Variable -Name "$dec-$city" -Scope Global -ErrorAction SilentlyContinue
if ($variable -ne $null){
$dec+"--"+$city+"--"+$variable.Value;
my sample data looks like this
col1 | col2 | col3
abc | qwe | poi
abc | jhg | dfg
de | wer | rew
de | iuz | mnb
abc | qwe | iop
de | wer | asd
Regards,
Hristo Valev
Developer-Hotline for MSDN Online Germany
Disclaimer:
Please take into consideration, that further inquiries cannot or will be answered with delay.
For further information please contact us per telephone through the MSDN-Entwickler-Hotline:
http://www.msdn-online.de/Hotline
For this post by the MSDN-Entwickler-Hotline the following terms and conditions apply:
Trademarks,
Privacy
as well as the separate
terms of use for the MSDN-Entwickler-Hotline.

Similar Messages

  • Generate Excel file via code

    Hi,
    I know the user can export an Excel file once the report viewer is loaded, but I was wondering if it's possible to generate an Excel file via code (no viewer loaded)?
    thanks,
    Ron

    Yup.
    You can find export samples in our [Crystal Reports .NET SDK samples|https://www.sdn.sap.com/irj/boc/sdklibrary?rid=/library/uuid/d0bf8496-2a81-2b10-95ac-b1f48d5b63f5]
    Jason

  • Date formatting issue when sending excel file via mail

    hello People ,
    I am facing date issue .
    I have inetrnal format of date as yyyymmdd.
    I am converting it into  YYYY-MM-DD.
    CONCATENATE gs_output-end_date(4)
                        gs_output-end_date+4(2)
                        gs_output-end_date+6(2)
                        INTO lv_date_to SEPARATED BY gc_seperator. " gc_separator = '-'.
            gs_output-end_date = lv_date_to.
    I am writing this date and sending an excel file via MAIL . I get date result as MM/DD/YYYY always.
    Now if i pass in YYYY.MM.DD and used the same code where gc_separtor = '.'.
    I get output as YYYY.MM.DD.
    Can any one give me an idea why in format YYYY-MM-DD it is getting overwritten but for yyyy.mm.dd it gives me as yyyy.mm.dd?
    Regards,
    Abhi..
    Edited by: Thomas Zloch on Jul 11, 2011 2:30 PM - subject enhanced

    Thanks , Rohit ,
    I have change my date format in SU01 settings .
    It is now made to [ YYYY-MM-DD] but still '-' is replaced by MM/DD/YYYY.
    Also note that when i format in the following way
       CONCATENATE gs_output-rdadate(4)
                        gs_output-rdadate+4(2)
                        gs_output-rdadate+6(2)
                        INTO lv_rda_date.
    instead of
       CONCATENATE gs_output-rdadate(4)
                        gs_output-rdadate+4(2)
                        gs_output-rdadate+6(2)
                        INTO lv_rda_date sepearted by '-'.
    I get output as YYYYMMDD.
    Regards,
    Abhishek.

  • Unable to edit Excel file via WebDAV in IE

    LS,
    Aim
    To be able to open an Excel file in Oracle Portal via IE for editing (ergo, if changed it needs to be saved in the same location where it resides = database)
    What have we done so far
    OraDAV has been implemented (basic manner), a pagegroup has been created in Oracle Portal for security, next we stored some Excel files for test purposes.
    Opening and editing using Windows Explorer (when testing) works fine, but opening from browser (Internet Explorer) opens Excel-file in read-only mode!
    Workaround
    Create windows shortcuts to Excel files in the OraDAV Webfolder, shortcuts are then placed in a public Windows-share which is running on a workstation.
    Accessing these shortcuts from both Windows Explorer and Internet Explorer works fine then.
    But...
    Unfortunately, implementing a windows share on a server is considered to be not an option by the network security team, and it's also not an option to continue using a workstation for that purpose.
    What does Metalink say (we created TAR for this)
    CLARIFICATION
    ====================
    This issue happens on WEBDAV.
    Using=>Windows Explorer it works fine.
    Using=>Internet Explorer it does not do as the customer aspected.
    Webdav:
    Using=>Windows Explorer
    going to folder
    http://<machine>:7778/dav_portal/.../QA1.XLS
    double clicked QA1.XLS and this opens in Microsoft Excel.
    After made modifications the file is saved correctly without any issue.
    Using=>Internet Explorer
    Calling the
    URL:http://<machine>:7778/.../QA1.XLS
    the file QA1.XLS opens within Internet Explorer the Microsoft Excel plugin.
    Problem is it the file opened in read-only mode and when you click save it wants to save
    in local drive.
    ISSUE VERIFICATION
    ===================
    Verified the issue by the OWC session.
    RESEARCH
    =========
    TESTCASE
    I have tested the same issue on 9.0.2.3 and 10.1.2 portal versions.
    They are all behaving the same.
    CAUSE DETERMINATION
    ====================
    This is intended behaviour.
    CAUSE JUSTIFICATION
    ====================
    Details => http://www.webdav.org
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/OTN_CONTENT/MAINPAGE/PUBLISH_CONTMGMT/TECHNOTE_WEBDAV.HTML
    What does Portal documentation say
    Source: Oracle9iAS Portal Release 2 –Technical Overview
    An Oracle White Paper; April 2002; Page 17
    =======================================================
    Integrating with the desktop
    File-type item content can also be published to the portal repository via the Webbased Distributed Authoring and Versioning (WebDAV) protocol. Using a WebDAV client such as Windows Explorer, a portal page group can be mapped as a Web Folder. Users can then simply drag and drop content, files, and folders between portal pages and the desktop. File-type items can also be opened, edited, and saved directly from WebDAV desktop applications like MS Office 2000.
    Thus...
    Even though Metalink is implying it is not possible, one would think it IS possible, since IE is also a valid WebDAV client.
    Bottom line
    Does anyone know how to set up Portal in combination with WebDAV to ensure editing of Excel files will happen via Internet Explorer AND changes will be saved back onto the original location
    Thanks, Patrick

    hi patrick,
    this problem is not solvable on the serverside since this is a desktop integration problem. since you want to use excel as your editor you have to use excel's client side software.
    oracle drive purely addresses desktop integration and is not meant to be a server side component. it is a webdav client and for that only ensures that the communication between the client and the portal server has as much useful functionality as possible.
    the only other option that i see is downloading the document to the client, update it and copy it back up to the portal server, which is cumbersome.
    all webdav clients are client side software that is either shipped with the OS (MS webfolders) or needs to be installed on the client (oracle drive).
    you could check if there is software availble that is an excel plug-in for internet explorer which at the same time talks webdav to portal. not sure if this exists ?
    regards,
    christian

  • "Open method of Workbooks class failed" when opening Excel file via Internet Explorer

    (apologies, I posted this first to the general Office 2010 forum, but then realized this was probably a better spot to post)
    We have an Excel COM add-in installed on users' PCs.  This add-in responds to workbook open events by opening a particular XLA file (also deployed to the PC) to make certain features available.  This process works flawlessly when Excel files are
    opened locally - but when a user attempts to open an Excel file from an IE link, we get the following error: "Open method of Workbooks class failed".  This is happening on the line that is trying to open the XLA file.  This only happens
    when launching an Excel link from IE - works fine in Chrome or Firefox.
    I have found several posts on this topic, but no solutions:
    1. This post (https://social.msdn.microsoft.com/forums/office/en-US/73c96005-84af-4648-b103-32b677205be3/open-method-of-workbooks-class-failed)
    is the closest to our problem.  In this case, the "answer" was that the user may not have access to the 2nd workbook being opened.  But in our case, we're opening an XLA that is on the local machine, and I've confirmed that it is not
    corrupt and accessible (read & write, just in case!) to Everyone.
    2. This (very old) post (http://www.pcreview.co.uk/forums/open-method-workbooks-fails-excel-hosted-ie-t965608.html)
    seems similar, but is talking about opening Excel inside of IE.  This is not what we're doing - the link is supposed to (and does) open Excel outside of IE.  Interestingly, Excel.exe is being launched with the "-embedded" flag, even
    though it isn't running in the IE window.  When launching Excel by opening the file locally, Excel.exe is run with the "/dde" flag instead.  Clearly the "-embedded" mode is what is causing the problem.  I could change the
    links on the web page to use some JavaScript to open Excel differently... unfortunately, the links are actually generated by SharePoint (the Excel files are in a SP repository), so this is not really an option.
    3. This Microsoft KB article (http://support.microsoft.com/kb/268016) talks about problems opening an XLA directly from IE... but this is the case of a link pointing
    directly to an XLA file, not opening a regular workbook that in turn opens an XLA, as is my case.  In fact, this article specifically points out in the "More Information" section that "End users do not normally open XLAs; instead they open
    an XLS that (if needed) loads one or more XLAs during startup." ==> precisely what I'm trying to do that is giving me the error!
    I've replicated the situation with a very simple COM add-in (created in VS2010 using VB.Net) and a very simple XLA file (does nothing, just pops up a message in auto_open).  For anyone wanting to try it out, here is the exact test case:
    1. In Excel, create a simple XLA file containing only the following code, and save it in C:\TEMP\dummy.xla:
    Sub Auto_Open()
    MsgBox "Auto Open fired"
    End Sub
    2. In Visual Studio, create a new Excel 2010 Add-In.  I created mine via Visual Basic, but I doubt the choice of language matters.  Place the following code in ThisAddin.vb:
    Public Class ThisAddIn
    Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
    AddHandler Me.Application.WorkbookOpen, AddressOf Application_WorkbookOpen
    End Sub
    Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
    End Sub
    Sub Application_WorkbookOpen(ByVal workbook As Excel.Workbook)
    On Error GoTo ErrHandler
    If (Not workbook.Name.Contains("dummy.xla")) Then
    MsgBox("Workbook open")
    Application.Workbooks.Open("C:\temp\dummy.xla")
    Application.Workbooks("dummy.xla").RunAutoMacros(Excel.XlRunAutoMacro.xlAutoOpen)
    End If
    Exit Sub
    ErrHandler:
    MsgBox(Err.Description)
    End Sub
    End Class
    3. Build & publish this add-in and install it on the same machine as the XLA created in step 1.
    4. Create and save an empty Excel workbook (I called mine WayneTest1.xlsx) - save it locally (on your desktop), and put a copy somewhere on your web server (I put mine directly in c:\inetpub).
    5. Create an HTML file with a link to that workbook, saving it to the same web server location - here is mine:
    <html>
    <body>
    <a href="WayneTest1.xlsx">Link to Excel file</a>
    </body>
    </html>
    6. Double click the workbook on your desktop (from step 4) - opens fine, I get the "workbook open" message, following by the "Auto Open fired" message.
    7. In Internet Explorer, navigate to the HTML file specified in step 5 and click on the link - when prompted, select "Open" - I get the "workbook open" message, following by the error message "Open method of Workbooks class failed".
    Here are a few things I've ruled out / tried so far:
    - Unchecked all the "Protected View" settings in Excel, made no difference
    - Unchecked all the "File block settings" in Excel, made no difference
    - Made sure dummy.xla was open for read & write to Everyone
    - Made sure the web page was in Trusted sites and set the security level to Low for those sites in IE
    - Tried making the local desktop file (step 6) readonly, made no difference (i.e. launching it locally still worked fine)
    - Tried using Excel 2013 - made no difference
    Any ideas / suggestions?

    Hello Wayne,
    Apologies for the delay.
    I went through your post and tried to reproduce the issue. I was able to reproduce it. Based
    on its complexity and as it requires more in-depth analysis, your question falls into the paid support category which requires a more in-depth level of support.
    Please visit the below link to see the various paid support options that are
    available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
    Thanks,
    Anush

  • I need AD Health status via Power Shell script

    Dear All,
    I need AD Health power shell script and it has to be sent via email as report on daily basis
    Can anyone help on this?
    Thanks,
    Pushparaj

    I found below script which can be used, but i would request run these scirpts in test environment before executing in production.
    http://fearthemonkey.co.uk/using-powershell-to-perform-dc-health-checks/
    http://www.wolffhaven45.com/blog/powershell/automate-some-active-directory-health-checks-via-powershell/
    You can also search for scripts in below repository.
    http://gallery.technet.microsoft.com/
    Also, for scripting related request, its better to post the thread in dedicated scripting/powershell forum.
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Awinish Vishwakarma - MVP
    My Blog: awinish.wordpress.com
    Disclaimer This posting is provided AS-IS with no warranties/guarantees and confers no rights.

  • Parse Excel File via PowerShell for a loop

    Hello everyone,
    I would like to parse a column of one of my Excel file to retrieve the string that each of its cell can contain.
    This will be used to set the appropriate value of the UPN of users in a specific OU in Active Directory.
    The first column being the SAMAccountName and the second column the email address, I would like a loop that for each match of SAMAccountName it finds in the first column, it sets the value of associated row in the second column as its UPN.
    I know already the Active Directory cmdlets I would have to use, they works but I do not succeed retrieving data  like I would like from the Excel file.
    If someone could help me out on this that will be appreciated :)
    Thanks a lot.

    Hi,
    This might help:
    http://gallery.technet.microsoft.com/scriptcenter/7b2fdc8f-a528-4f19-b9ef-f5af349dc906
    I haven't used this module myself, so I'm not sure how well it works.
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • Execute an Excel-file via SAP VBS

    I am starting usind VBS with SAP. I have some experience with VBA for Excel.
    So I have written a Excel-Makro which I can run via a URL-Link in SAP. This works perfect for me, but how can I get it run for my colleagues?
    The problem is, that that VBS-Code works with a special favorite-ID:
    session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").selectedNode = "F00009"
    But this ID varies depending on the colleagues.
    How can I run this Excel-Makro without using a favorite?
    Thanx for the help,
    Lutz

    Hi Lutz,
    slowly, I realize what this is about.
    1. You could maintain your way and try the following.
    for example:
    Instead of using:
    session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").selectedNode = "F00009"
    session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").pressKey "Enter"
    to use this:
    session.findById("wnd[0]/tbar[0]/btn[71]").press
    session.findById("wnd[1]/usr/txt130_FIND").text = "myExcel-File"
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").pressKey "Enter"
    2. Or you could start with the favorites also a VB script , which then launches an Excel macro.
    for example:
    set Wshell = CreateObject("WScript.Shell")
    wshell.run "c:\tmp\myExcel-File_Auto_Open.xlsm",1,false
    or:
    on error resume next
    Set xclApp = GetObject(, "Excel.Application")
    If Err.Number <> 0 Then
      Err.Clear
      Set xclApp = CreateObject("Excel.Application")
    End If
    on error goto 0
    xclapp.ScreenUpdating = false
    xclapp.Visible = false
    xclapp.DisplayAlerts = false
    xclApp.Workbooks.Open("c:\tmp\myExcel-File_No_Auto_Open.xlsm")
    xclapp.Run "myExcel-File_No_Auto_Open.xlsm!myExcel-Macro", wscript.arguments(0), wscript.arguments(1)
    3. Or you could use GuiXT and InputAssistant and the command pushbutton with parameter process: Synactive         and    Synactive documentation
    With Pushbutton you can create your own pushbuttons within an SAP screen or within the toolbar. You can make both the menu functions and the navigation to other transactions directly accessible with your own pushbuttons.
    Pushbutton (row,column) "Pushbutton text" "FCode" Process="..." 
    Adds a pushbutton on position (row,column). The pushbutton invokes the internal codeFCode. This can be a code from the menu, e.g. SCMP, a transaction code like /NFB01 or/OMM02 or a F-key or a combination of F-keys in format /nn.
    Process="..."  relates to the InputScript file. You can omit the "fcode" parameter if only "Enter" is needed in order to continue with the transaction.
    4: Or with GuiXT and without InputAssistant:
    With Image you can display image files in the SAP screens. What is the point of having images and graphics in SAP screens? Four principal reasons spring to mind. Firstly, to create a recognizable context. Secondly, to orientate us within a screen. Thirdly, to give the screen a personal, friendly touch. Fourthly, images can carry a mass of vital information, in particular if the choice of image is data dependent.
    By clicking on the image, you can start PC applications. This is obtained by using the additional parameter Start="string":
    Image (row,column) "Name of image file" Start="string"
    You can display documents of all registered file types
    You can start .exe or .bat files with parameters
    5. Or . . .
    Regards,
    ScriptMan

  • Error while opening an excel file via labview

    i don't know why i get this message,then the excel won't open at all

    It appears that the New Report .vi only accepts the .xlt template format and not .xltx as one would commonly expect. I am currently working to determine for sure that this is the case, but it does run (mostly) properly on my end if you make that change.
    When I say mostly, I mean there are a couple other minor issues with your code. First the first frame of your sequence structure is really accomplishing anything. If your intent is to open a reference to the excel template, there is no need because the New Report .vi does it automatically.
    Second, you will need a file path of some sort wired in to your Save Report to File .vi or else you will get a different error message after fixing the .xlt issue. I am currently researching whether this should be marked as a required terminal instead of recommended so that it not being wired would result in a broken run arrow rather than an error.
    Let me know if these suggestions resolve your issue, or if I can provide further input on what you are doing in your first frame. I will touch base again once I determine whether these are expected behaviors or bugs.
    Christopher S. | Applications Engineer
    Certified LabVIEW Developer
    "If in doubt... flat out." - Colin McRae

  • How can I list print queues per server via power shell script

    Hello,
    we are managing many print servers on our domain environment,  now for auditing purpose I need to report print queues per server,  and it seems bit difficult task doing it via GUI in print management view, could someone help me with script which
    gets me the no. of print queues on each print server.
    Also I need to list all the print drivers installed on each print servers. 
    I tried to list the drivers " Get-WmiObject win32_printerDriver -filter " but this will get me complete information about the driver, I need to list only the driver name (-filter) either _RELPATH or _PATH
    dibu

    You can also use WMI like this:
    (get-WmiObject win32_printer -computer ws702).count
    I don't understand what you mean by list only.  Just select what you need.
    See: http://technet.microsoft.com/en-us/scriptcenter/dd742419
    That will give you some basic background on how to use PowerShell to get the properties of objects.
    ¯\_(ツ)_/¯

  • Rename a set of files in Power Shell

    Hello Scripting Guys,
    I am trying to rename a group of files in a given directory.  The files all start with a number and a dash (such as "1 - " or "24 - ") when I first get them. Sometimes there are files that do not start with a number or a dash in
    the same directory, but I don't want to bother with those.  Of the files that do have a number and a dash, they should all be .SQL text files (have a .SQL extension).  
    I want to loop through all files that meet these criteria and then rename them to the same name, but without the number and the dash.  For example a file may have a name like "1 - cust_sp_Get_Last_Order.sql"  I want to just rename this
    to "cust_sp_Get_last_order.sql" and be done with it.  
    I would be done by now in VBScrpt, but I am trying to learn the bloody PowerShell and it is driving me crazy.
    Here is what I came up with, but it chokes on the substring piece.  If I test the substring bit by itself with variables it seems to work fine.  it just does not work in this script.  Please help.
    $depfiles = gci c:\Temp -filter *.txt              
    $depfiles | %{ [int]$dash_pos = $_.name.indexof("-"); 
                   [int]$start = $dash_pos+2;
                   [int]$dot = $_.name.indexof(".");
                   [int]$end = $dot+3;
                   $start; $dot; $end;
                   [string]$nameonly = $_.name;
                   $new_name = $nameonly.substring($start, $end);
                   write "Name:" $nameonly; write "New Name:" $new_name
    And this is what I get in return....
    Exception calling "Substring" with "2" argument(s): "Index and length must refer to a location within 
    the string.
    Parameter name: length"
    At C:\Users\Tom\Desktop\3rd try.ps1:9 char:47
    +                $new_name = $nameonly.substring <<<< ($start, $end);
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    Thank you.

    Thank you both very much.
    This was very helpful. The problem was I was passing the wrong value to Substring's second parameter.  The value was too high.  The value should be calucated as Brian noted: $length = $_.name.Length - $Start is correct.  I was counting spaces
    from start of the string and not after the dash.
    I had put "*.txt" to test it out on some test files but forgot to change it back.
    Here's a semi-working version.   
    $destination = "c:\deployed\"
    $depfiles = gci c:\Temp -filter *.sql
    cd c:\temp
    $depfiles | %{ [string]$nameonly = $_.name;
                   [int]$dash_pos = $_.name.indexof("-"); 
                   [int]$start = $dash_pos+2;
                   [int]$end = $nameonly.length;
                   $end = $end-$start;
                   $new_name = $nameonly.substring($start, $end);
                   write ""; 
                   write "";
                   if ($dash_pos -gt 0) {
                        write "Name:" $nameonly; write "New Name:" ($destination + $new_name);
                        rename-item -Path $_.fullname -NewName ($destingation + $new_name);    
    The rename-item cmdlet is only renaming them in the current directory, and not moving them to the deployed folder, but I need to play with it some more.  
    The variables all look right however.  Any ideas?
    Output:
    Name:
    100 - some data.sql
    New Name:
    c:\deployed\some data.sql
    Name:
    2 - big data.sql
    New Name:
    c:\deployed\big data.sql
    Name:
    99 - this is a test.sql
    New Name:
    c:\deployed\this is a test.sql

  • Faster way to read XML files using power shell !!

    At the moment i have about 1000 XML files (ranging from size 15kb to 120kb), I have a powershell script which extracts information and writes all extracts to the same LOG file!!
    It works well but am only concerned with the time it takes!! it took about 1.5 hrs to finish the script! Is this normal?
    How can i speed it up, your inputs and thoughts helps!!
    Reading XML using the following syntax!
    $Inputfile=[xml](Get-Content $XFILE)
    Script has only foreach loop!  and no other conditions.
    cheers!

    For a small file it is about twice as fast.  It gets faster as the file size gets bigger.
    PS C:\scripts> Measure-Command {$xml=[xml](cat FooProx.xml -raw)}
    Days : 0
    Hours : 0
    Minutes : 0
    Seconds : 0
    Milliseconds : 275
    Ticks : 2758195
    TotalDays : 3.19235532407407E-06
    TotalHours : 7.66165277777778E-05
    TotalMinutes : 0.00459699166666667
    TotalSeconds : 0.2758195
    TotalMilliseconds : 275.8195
    PS C:\scripts> Measure-Command {$xml.Load("$pwd\FooProx.xml")}
    Days : 0
    Hours : 0
    Minutes : 0
    Seconds : 0
    Milliseconds : 108
    Ticks : 1081647
    TotalDays : 1.25190625E-06
    TotalHours : 3.004575E-05
    TotalMinutes : 0.001802745
    TotalSeconds : 0.1081647
    TotalMilliseconds : 108.1647
    ¯\_(ツ)_/¯

  • Lan/WLan Switiching via power shell or VBS

    Hello there,
    Is there any way that I can Enable the bios setting Lan/Wlan switching wth VBScript or Powershell for the OS. I would like to roll this optin out via SCCM.

    I came across this webpage in which someone creatd a script to enable WLAN/LAN switching via a VBS.
    I have tested this on an HP 8460P. I would assume it works on 8470P as well.
    http://www.kozeniauskas.com/itblog/2008/01/18/remotely-change-bios-settings/
    God bless you!

  • What is the meaning of the status value in resulted table via power shell command?

    Hello,
    I have queries about result given by powershell command:
    Get-WmiObject -Class Win32_Processor results Status code as
    OK - What does it mean ? what are other status code options  ?
    Get-WmiObject -Class Win32_ComputerSystem results Status code as OK - What does it mean ? what are other status code options  ?
    [System.Net.WebRequest]::Create($site) > GetResponse() results StatusCode as OK - What does it mean ? whats are other status code options  ?
    Would you please clarify ?
    Thanks and Kind Regards,
    Dipti Chhatrapati

    Dipti...Check the msdn site for that particular class for all the info.
    The values will differ from class to class.
    http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx
    Status
    Data type: string
    Access type: Read-only
    Qualifiers: MaxLen (10)
    Current status of an object. This property is inherited from CIM_ManagedSystemElement.
    The values are:
    "OK"
    "Error"
    "Degraded"
    "Unknown"
    "Pred Fail"
    "Starting"
    "Stopping"
    "Service"
    "Stressed"
    "NonRecover"
    "NoContact"
    "LostComm"
    Thanks Azam When you see answers please Mark as Answer if Helpful..vote as helpful.

  • Excel file can't open via email after upgrading to OSX 10.9.2

    After upgrading to OSX 10.9.2, my Excel files are not readable when sent by email. My version for Excel is 2008 for Mac V12.3.6.
    I have no trouble opening Excel on my computer but cannot seem to send Excel files via email.

    Thanks. Tried that and it works but I had found another alternative.
    Didn't realise but my Excel file had the extension missing even though it was saved as xlsx. To solve the problem, I just clicked on 'Append the File Extension' when I 'Saved As' and it worked. Thanks for the alternative help anyway.

Maybe you are looking for

  • Performance Tuning in LSMW

    Hi Can Anyone explain me how can we increase the performance of the LSMW when created with the recording. Thanks a lot

  • CS6 PhotoShop hanging when opening PDFs - help?

    Hi all, I'm IT support to a team of studio artists who are having some issues with our newly upgrade CS6 Premium suite (Mac OS 10.6 + Mac OS 10.8). Situation: (Mac OS 10.6 problem) someone will be working on a 2GB network file, and tries to open a PD

  • Can't access mask in gradiant tool in lightroom 2

    I have recently purchased Lightroom 2 and when using the gradiant tool I can't access the mask option? Also with the brush tool the erasure option does not always work. I'm working on a pc. Thank you. Mark

  • Form won't open until SQL Plus finishes querying

    We have Dev.6 Forms patch 5a, NT, Oracle 8.0.5.2.1. If I run a query such as select count(*) from a large table and while this is running I run a form from within form builder the runtime of the form will not come up until SQL PLUS 8.0.5.0.0 returns

  • Bdc recording of infotype 24 for qualification

    Hi Frn's ,   i want to record bdc of infotype 24  for qualification . but i am not able to input the value of qualification in table control . for this i have to search click the create button given in bottom and after that a pop up is raising  to se