Problem with Script Task formatting excel
Hi Experts,
I am creating a package and using Script task to format one excel dimension file, now the problem is if I execute the package from BIDS designer with static values then the package executes fine with excel file formatted perfectly fine but if I execute same package in BPC via Data manager with values used from variables it gives error on script task message:
"Description = System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file 'E:\PC_MS\Data\Webfolders\CDNPLAN\AdminApp\Stage\Employee.xls'. There are several possible reasons:
u2022 The file name or path does not exist.
u2022 The file is being used by another program.
u2022 The workbook you are trying to save has the same name as a currently open workbook.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at ScriptTask_2921447fa19c44dfae73d5370828ba94.vbproj.ScriptMain.Main()
Now to crosscheck I commented the dynamic variables from the code and used same static values with Data manager as they are in BIDS but it didn't help, please find the code below and help me in solving this problem or just give me some clue to come out if this:
Thanks & Regards,
Rohit
Code
Public Sub Main()
' Add your code here
'Dim FileName As String = Dts.Variables("MYWEBFOLDERS").Value & Dts.Variables("MYAPPSET").Value & "\AdminApp\Stage\" & Dts.Variables("MYDIMNAME").Value & ".xls" This I commented as it was using dynamic variables
Dim FileName As String = "E:\PC_MS\Data\Webfolders\CDNPLAN\AdminApp\Stage\Employee.xls"
Dim WB As Object ' Workbook
Dim WS As Object 'Worksheet
Dim W As Object 'Window
Dim XL As Object 'Application
XL = CreateObject("Excel.Application")
XL.DisplayAlerts = False
' Open the workbook
WB = XL.Workbooks.Open(FileName)
' WB = GetObject(FileName)
' XL = WB.Parent
' XL.DisplayAlerts = False
WS = WB.Worksheets(1)
W = WB.Windows(WB.Name)
' Change the name of the worksheet to MEMBERS
WS.Name = "MEMBERS"
' Set up the split and freeze the panes
W.SplitRow = 1
W.SplitColumn = 1
W.Split = True
W.FreezePanes = True
' Make it visible
W.Visible = True
' Replace *ID column header with ID
Dim Row1 As Object
Row1 = WS.UsedRange.Rows("1:1")
Dim I As Integer
For I = 1 To Row1.Columns.Count
If Row1.Cells(I, 1).Value = "*ID" Then
Row1.Cells(I, 1).value = "ID"
Exit For
End If
Next
' Paste Values
WS.UsedRange.NumberFormat = "@"
WS.UsedRange.Value = WS.UsedRange.Value
' Change the font of everything to Arial,9
With WS.Cells.Font
.Name = "Arial"
.Size = 9
End With
' Format the top row to be bold and orange
With WS.Rows("1:1")
.Font.Bold = True
.Interior.ColorIndex = 44 'orange
End With
' Auto-fit all the columns
WS.Cells.EntireColumn.AutoFit()
' Convert to Excel format
Const xlNormal = -4143
WB.Parent.DisplayAlerts = False
WB.SaveAs(FileName:=FileName, FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False)
' Close and save changes
WS = Nothing
WB.Close()
W = Nothing
' Quit Excel
XL.Quit()
XL = Nothing
Dts.TaskResult = ScriptResults.Success
End Sub
Hi,
If you do not define GLOBAL VARIABLE in your BPC package and BIDS, why don't you try to have it? you should specify the webfolder and file name in advanced script, then you also need to create global variable as text type in BIDS.
I saw many cases BPC does not pass the dynamic variable to BIDS, therefore I changed the type of variable as the Global variable and it works for me.
Regards,
YH Seo
Similar Messages
-
Problem with controlling Annotations from Excel VBA
Hi,
I have a PDF document that has plenty of sticky notes attached to it. These sticky notes have been added by multiple authors on all pages of the document. I am trying to import the contents of these sticky notes, their author and the page number to an excel spreadsheet. I am using Excel 2007 and Acrobat Professional 9.0.
This is the code that I am currently using to import the sticky notes, but the problem that I am facing is that when I run the macro -
Same sticky note contents, author and page numbers are imported multiple times
Not all sticky notes are imported, only some of them appear in the final excel spreadsheet
When I compare the number of sticky notes to that in the original PDF file, the number is correct. But the content is repeated content and that is the reason why only some of the sticky notes are imported.
This is an activity that I need to do on regular basis and the number of sticky notes that I need to import to excel may range between 100 to 200. It is really difficult to do this task manually, so an excel VBA macro could prove really helpful.
Sub ImportComments_Click()
Dim Fpath As String
Dim WordObj As Object
Dim wbkOutput As Excel.Workbook
Dim iRow As Integer
Dim i, j, k As Integer
Dim lRet As Long
Dim objAcroAVDoc As New Acrobat.acroAVDoc
Dim objAcroPDDoc As Acrobat.AcroPDDoc
Dim numPages As Long
Dim lAnnotscnt As Long
Dim Subtype As String
Dim NumComments As Long
Dim AcroApp As Acrobat.AcroApp
Dim objAcroPDPage As Acrobat.AcroPDPage
Dim annot As Acrobat.AcroPDAnnot
Sheets("Defect Log").Select
Range("L3").Activate
Fpath = ActiveCell.Value
Sheets("Defect Log").Select
Range("A1").Activate
i = 0
Do While (Not (IsEmpty(ActiveCell.Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 1).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 2).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 3).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 4).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 5).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 6).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 7).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 8).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 9).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 10).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 11).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 12).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 13).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 14).Value)))
i = i + 1
ActiveCell.Offset(1, 0).Select
Loop
iRow = i + 1
Set wbkOutput = ActiveWorkbook
lRet = objAcroAVDoc.Open(Fpath, "")
Set objAcroPDDoc = objAcroAVDoc.GetPDDoc
numPages = objAcroPDDoc.GetNumPages()
Set objAcroPDPage = objAcroPDDoc.AcquirePage(0)
For k = 1 To numPages
lAnnotscnt = objAcroPDPage.GetNumAnnots()
For m = 0 To lAnnotscnt - 1
If lAnnotscnt = 0 Then Exit For
Set objAcroPDAnnot = objAcroPDPage.GetAnnot(m)
If (objAcroPDAnnot.GetContents <> "" And objAcroPDAnnot.GetSubtype = "Text") Then
Cells(iRow, 5).Value = k
Cells(iRow, 2).Value = objAcroPDAnnot.GetContents()
Cells(iRow, 11).Value = objAcroPDAnnot.GetTitle()
iRow = iRow + 1
End If
Next m
Set objAcroPDPage = objAcroPDDoc.AcquirePage(k)
Next k
lRet = objAcroAVDoc.Close(1)
Set objAcroAVDoc = Nothing
Set objAcroPDAnnot = Nothing
Set objAcroPDPage = Nothing
Set objAcroPDDoc = Nothing
End SubMake sure you are current with 9.x patches, just on general principles.
The code seems fine – nothing jumping out at me.
You can also look at using the JSObject methods and trying this via the JavaScript stuff – that will give you more access to the Annotation information…
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Thu, 24 Nov 2011 04:25:12 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: Problem with controlling Annotations from Excel VBA
Problem with controlling Annotations from Excel VBA
created by apreeti<http://forums.adobe.com/people/apreeti> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4044740#4044740 -
I am unable to properly print a playlist in the jewel case format. All lines bunch together. I have no problem with other print formats. Help please.
If it is a USB powered external, no AC adpater, that may be the reason. Mac notebooks are known to have low powered USB ports. You can get around that with a Y USB cable to connect to 2 USB ports at the same time.
-
Problem with complete task via email
Hello,
I have problem with complete task via email. I found this blog very useful (http://blogs.adobe.com/ADEP/2010/11/how-to-complete-a-task-via-email-using-reply-to-comple te.html), but...
I set up everything as it’s written in blog mentioned above. When a task is assigned to me, I received an email notification with actions (accept, deny). After that I replied with action “accept”. Then I received email with subject “Errors from LiveCycle ES”:
LiveCycle ES has tried to process your request and encountered the following error:
com.adobe.pof.POFRuntimeException: Transaction is not active: tx=TransactionImple ; – nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple )
This response to your original email
Subject:RE:Task Assignment – Process: Test/Email_Test. Task 76 has been assigned to you.
Date Sent:Thursday, October 24, 2011 1:17 PM
Body:accept
DO-NOT-DELETE: MTMhMzE0ITMyOA==!
Attachments:
In log appeared this following error:
Caused by: ALC-DSC-215-000: com.adobe.idp.dsc.DSCRuntimeException: None of the Auth Provider could authenticate the user. Authentication Failed
at com.adobe.livecycle.notification.TaskNotificationServiceImpl.processEmailComplete(TaskNot ificationServiceImpl.java:1157)
Can you me please? I have no idea what to do to succesfully complete task via email endpoint. Thanks
Jan PetrlaHi Diana, thanks for your reply.
You're probably right about 2 different error messages.
To the 1st one: I'm sure that status task is Assigned (to me). I received an email and I also reply on that email.
To error log: I found out that error log appears when I enable email endpoint on Complete Task service. But I managed to solve this problem. I set wrong user. Now I have here the same user as is written in login-config.xml so log seems to be ok.
So I created new task and tried to complete it via email. Now I receive email with another error:
LiveCycle ES has tried to process your request and encountered the following error:
com.adobe.idp.dsc.provider.service.email.impl.EmailProviderException: Error getting user context
This response to your original email
Subject:RE:Task Assignment - Process: WorkFlowClient/Test. Task 92 has been assigned to you.
Date Sent:Thursday, October 27, 2011 3:05 PM
Body:Complete
DO-NOT-DELETE: MTIxMSExNjAzITIwMTE=!
Attachments:
And to the last point: email endpoint is set up with TestPOP3@mydomain and user receiving email has jpetrla@mydomain. I use Lotus Notes as email client, I tried another account with gmail, but the result was same.
Now I really don't know to do...
Jan -
Problem with remove task from schedule in PWA
In our environment problem with remove task from schedule by PWA.
Problem is only when I want to remove few task in the same time, but the operation one by one is correct.
In my opinion problem is with calculation schedule after remove tasks, column ID include wrong value it means that Number ID does not generate in the correct order same of numer
disappear. Click Calculate button on ribbon causes problem with finshed operation and save project.
Problem occurs only machine with IE 11.0 browser without compability mode, on other machine for example on the same project with IE 8,9,10 everything is correct.
Problem appeared recently, earlier everything was OK.
Txn, Dariusz MoczyńskiHi Darius,
I'm a bit confused. You are now talking about 2 issues.
For the first one, you cannot edit anymore tasks in PWA, with any browser versions? Is it happenonog for any users on any projects? Try the following solutions publish the project from Project Pro and see if it helps. Press CTRL F5 to delete IE cache. Ensure
that your PWA URL is added to the trusted site and/or compatibility sites. Check for the ULS logs or javascript errors.
For the second issue, please refer to my previous reply, this obviously cannot be considered as a bug since it is happening with a non supported browser version and working properly on supported versions of IE.
Hope this helps,
Guillaume Rouyre, MBA, MVP, P-Seller | -
Problem with input data format - not "only" XML
Hi Experts,
I have problem with input data format.
I get some data from JMS ( MQSeries) , but input format is not clear XML.
This is some like flat file with content of XMLu2026.
Example:
0000084202008-11-0511:37<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
...content....
</Document>000016750
Problems in this file is :
1. data before parser <? xml version="1.0"> -> 0000084202008-11-0511:37
2. data after last parser </Document> -> 000016750
This data destroy XML format.
Unfortunately XI is not one receiver of this files and we canu2019t change this file format in queue MQSeries ( before go to XI) .
My goal is to get XML from this file:
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
...content....
</Document>
My questions:
1. Is any way or technique to delete this data 0000084202008-11-0511:37 in XI from this file ?
2. Is any way to get only XML from this file ?
Thanx .
Regards,
SeoHi Buddy
What is the XI adapter using?
If you use inbound File adapter content conversion you could replace these values with none and then pass it to the scenario.
Does that help?
Regards
cK -
Problem with downloading 2007 formats
I have a problem with downloading 2007 format files in my application. We can upload the 2007 formats without any problem. But, When we try to download them, we are receiving a 'Page cannot be displayed' error.
When we add the corresponding MIME-TYPES into IIS(Version 6.0) of the system(Test Environment), the problem got resolved. But there was a constraint to add the MIME-TYPES in the Production Box.
Can you please provide any alternate solution using CF code. I am pasting my sample code that my system is using for this.For CF to set the MIME type for those files, it would have to be configured as a handler for those file extensions. By default, CF doesn't process requests for files other than .cfm, .cfc, etc.
You could write a download application that uses CFCONTENT to push files to the client, but the user would have to request your CF page, which might have a URL like this:
http://yourserver/download.cfm?file=myfile.docx
Or, you could map those file extensions to CF, but that would be a bad idea for several reasons. Even if it wasn't a bad idea, it would be harder to change on the server than the MIME types in IIS.
Frankly, you should fix this the right way - by having the server administrator add the correct MIME types.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/ -
there is a pop up about a problem with script. it ask me end and contuniue the script. i didnt have that problem before. plz help me it gets really irritating. it asks a lot
This issue can be caused by an extension that isn't working properly.
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.com/kb/Safe+Mode -
Script Task - convert excel to txt
Hi,
I have an .xls file in a shared folder. How can we convert this file into a txt file and save it with a different name in the same or different folder.
Thanks
Syed FaizI’m not sure why you want to do that and your requirements but you can do this with a simple File System task instead of Script task.
Create a variable (strDest) of String type and provide the value - C:\SSISPackages\First\Forums\ExcelToTxt.txt
C:\SSISPackages\First\Forums\ is your destination path and ExcelToTxt is your Excel file name.
Drop a File System task
Select the Operation – Copy file
Source connection – Provide the connection to your Excel file
Destination connection – Provide the connection to your Destination folder (like - C:\SSISPackages\First\Forums\ i.e. where you want to copy the Excel file as Text file)
Now, go to your Destination Connection properties > Expressions > Connection String
> Select the variable – strDest as Expression
Execute the package.
Narsimha -
Certain sites, most recently The Daily Show, will not load for me. I get a box that says:
"Warning: unresponsive script
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: resource://gre/modules/ConsoleAPIStorage.jsm:157
[Continue] [Stop script]"
Whether I click to continue or stop the script, nothing happens except that the box goes away and then comes up again. If I try to close the tab, it just hangs and then finally shows the box again.
Finally, Firefox just gets completely hung up, and I have to close it out with the task manager.
Meanwhile, everything runs fine in Internet Explorer.
Can anyone please help me solve this problem?
Thanks,
EllenIs DOM storage enabled?
You can check the value of the dom.storage.enabled pref on the about:config page.
*http://kb.mozillazine.org/about:config
You can also try to delete the webappsstore.sqlite file in the Firefox Profile Folder to remove all data (cookies) stored in DOM storage.
You can use this button to go to the Firefox profile folder:
*Help > Troubleshooting Information > Profile Directory: Open Containing Folder
*http://kb.mozillazine.org/Profile_folder_-_Firefox
You can try to reset Firefox and create a new profile.
*https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems -
Problem with Cell size in Excel output of XML report
Dear all,
I am facing a problem with cell size when i run my XML report in Excel output. I found that it imitates the cell size of whatever i gave in the RTF. I cannot increase the cell size in RTF as my report contains 60 columns and max width of MS Word table is 22 inches.
Can any one suggest a way of doing this which shows full data in Excel sheet depending on the column data size with out any word wrap.
Thanks
RAJHi ,
You can try with
<xsl:attribute xdofo:ctx="block" name="wrap-option">no-wrap</xsl:attribute>
may be helpful to you
Thanks,
Ananth
http://bintelligencegroup.wordpress.com/ -
Having multiple problems with script - NTFS Permissions and AD Groups
Hi, all! I'm having multiple problems with my first script I've written with Powershell. The script below does the following:
1. Prompts the user for a corporate division under which a shared folder will be created, and adjusts variables accordingly.
2. Prompts if the folder will be a global folder or an office/location-specific folder, and makes appropriate adjustments to variables.
3. If a global folder, prompts for the name. If an office/location-specific folder, prompts for each component of the street address, city and state and an optional modifier. I've prompted for this information in this way because the information
is used differently later on in the script.
4. Verifies the entered information and requests confirmation to proceed.
5. Creates the folder.
6. Creates an AD OU and/or security group(s).
7. Applies appropriate security groups to the new folder and removes undesired permissions.
Import-Module ActiveDirectory
$Division = ""
$DivAbbr = ""
$OU = ""
$OUDrive = "AD:\"
$FolderName = ""
$OUName = ""
$GroupName = ""
$OURoot = "ou=DFS Restructure Testing OU,ou=Pennsylvania Camp Hill 4410 Industrial Park Rd,ou=Locations,ou=Camp Hill,dc=jacobsonco,DC=com"
$FSRoot = "E:\"
$FolderPath = ""
$DefaultFolders = "Archive","Customer Service","Equipment","Inbounds","Management","Outbounds","Processes","Projects","Quality","Reports","Returns","Safety","Schedules","Time Keeping","Training"
[bool]$Location = 0
do {
$userInput = Read-Host "Enter CLS Division: (W)arehousing, (S)taffing, or (P)ackaging"
Switch ($userInput)
W {$Division = "Warehousing"; $DivAbbr = "WHSE"; $OU = "ou=Warehousing,"; break}
S {"Staffing is not yet implemented."; break}
P {"Packaging is not yet implemented."; break}
default {"Invalid choice. Please re-enter."; break}
while ($DivAbbr -eq "")
write-host ""
write-host ($Division + " was selected.")
$FolderPath = $Division + "\"
write-host ""
$choice = ""
do {
$choice = Read-Host "Will this be a (G)lobal folder or (L)ocation folder?"
Switch ($choice)
G {$Location = $false; break}
L {$Location = $true; $FolderPath = $FolderPath + "Locations\"; $OU = "ou=Locations," + $OU; break}
default {"Invalid choice. Please re-enter."; $choice = ""; break}
while ($choice -eq "")
write-host ""
write-host ("Location is set to: " + $Location)
write-host ""
if ($Location -eq $false) {
$FolderName = Read-Host "Please enter folder name:"
$GroupName = $DivAbbr + " " + $FolderName
} else {
$input = Read-Host "Please enter two-letter state abbreviation:"
$FolderName = $FolderName + $input + " "
$input = Read-Host "Please enter city:"
$FolderName = $FolderName + $input + " "
$input = Read-Host "Please enter street address number only:"
$FolderName = $FolderName + $input
$GroupName = $DivAbbr + " " + $FolderName
$FolderName = $FolderName + " "
$input = Read-Host "Please enter street name:"
$FolderName = $FolderName + $input
$input = Read-Host "Please enter any optional information to appear in folder name:"
if ($input -ne "") {
$FolderName = $FolderName + " " + $input
$OUName = $FolderName
write-host
write-host "Path for folder: "$FSRoot$FolderPath$FolderName
write-host "AD Path: "$OUDrive$OU$OURoot
write-host "New OU Name: "$OUName
write-host -NoNewLine "New Security Group names: "$GroupName
if ($Location -eq $true) { write-host " and "$GroupName" MGMT" }
write-host
$input = Read-Host "Please confirm creation of new site/folder: (Y/N) "
if ($input -ne "Y") { Exit }
write-host
write-host -NoNewLine "Folder exists: "; Test-Path ($FSRoot + $FolderPath + $FolderName)
if (Test-Path ($FSRoot + $FolderPath + $FolderName)) {
Write-Host "Folder already exists! Skipping folder creation..."
} else {
write-host "Folder does not exist. Creating..."
new-item -path ($FSRoot + $FolderPath) -name $FolderName -itemtype directory
Set-Location ($FSRoot + $FolderPath + $FolderName)
if ($Location -eq $true) {
$tempOUName = "ou=" + $OUName + ","
write-host
write-host $OUDrive$tempOUName$OU$OURoot
write-host
write-host -NoNewLine "OU exists: "; Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)
if (Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)) {
Write-Host "OU already exists! Skipping OU creation..."
} else {
write-host "OU does not exist. Creating..."
New-ADOrganizationalUnit -Name $OUName -Path ($OU + $OURoot) -ProtectedFromAccidentalDeletion $false
$GroupNameMGMT = $GroupName + " MGMT"
if (!(Test-Path ($OUDrive + "CN=" + $GroupName + "," + $tempOUName + $OU + $OURoot))) { write-host "Normal user group does not exist. Creating..."; New-ADGroup -Name $GroupName -GroupCategory Security -GroupScope Global -Path ("OU=" + $OUName + "," + $OU + $OURoot)}
if (!(Test-Path ($OUDrive + "CN=" + $GroupNameMGMT + "," + $tempOUName + $OU + $OURoot))) { write-host "Management user group does not exist. Creating..."; New-ADGroup -Name $GroupNameMGMT -GroupCategory Security -GroupScope Global -Path ("OU=" + $OUName + "," + $OU + $OURoot)}
$FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
$FolderACL.SetAccessRuleProtection($True,$True)
# $FolderACL.Access | where {$_.IdentityReference -eq "BUILTIN\Users"} | %{$FolderACL.RemoveAccessRuleAll($_)}
$BIUsers = New-Object System.Security.Principal.NTAccount("BUILTIN\Users")
$BIUsersSID = $BIUsers.Translate([System.Security.Principal.SecurityIdentifier])
write-host $BIUsersSID.Value
# out-string -inputObject $BIUsers
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($BIUsersSID.Value,"ReadAndExecute,AppendData,CreateFiles,Synchronize","ContainerInherit, ObjectInherit", "None", "Allow")
$FolderACL.RemoveAccessRuleAll($Ar)
Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
get-acl ($FSRoot + $FolderPath + $FolderName) | fl
$FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
$ADGroupName = "JACOBSON\" + $GroupName
$objUser = New-Object System.Security.Principal.NTAccount($ADGroupName)
$objUser.Translate([System.Security.Principal.SecurityIdentifier]).Value
write-host $ADGroupName
write-host $objUser.Value
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($ADGroupName,"ReadAndExecute","ContainerInherit, ObjectInherit", "None", "Allow")
Out-String -InputObject $ar
$FolderACL.AddAccessRule($Ar)
$ADGroupName = "JACOBSON\" + $GroupNameMGMT
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($ADGroupName, "Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
Out-String -InputObject $ar
$FolderACL.AddAccessRule($Ar)
Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
} else {
$tempOUName = "cn=" + $GroupName + ","
write-host
write-host $OUDrive$tempOUName$OU$OURoot
write-host
write-host -NoNewLine "Group exists: "; Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)
if (Test-Path ($OUDrive + $tempOUName + $OU + $OURoot)) {
Write-Host "Security group already exists! Skipping new security group creation..."
} else {
write-host "Security group does not exist. Creating..."
New-ADGroup -Name $GroupName -GroupCategory Security -GroupScope Global -Path ($OU + $OURoot)
$FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
$ADGroupName = "JACOBSON\" + $GroupName
$FolderACL.SetAccessRuleProtection($True,$True)
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($ADGroupName,"Modify","ContainerInherit, ObjectInherit", "None", "Allow")
$FolderACL.AddAccessRule($Ar)
$FolderACL.Access | where {$_.IdentityReference -eq "BUILTIN\Users"} | %{$FolderACL.RemoveAccessRuleAll($_)}
Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
My problems right now are in the assignment/removal of security groups on the newly-created folder, and the problems are two-fold. Yes, I am running this script as an Administrator.
First, I am unable to remove the BUILTIN\Users group from the folder when this is an office/location-specific folder. I've tried to remove the group in several different ways, and none are having any effect. Oddly, if I type in the lines directly
into Powershell, they work as expected. I've tried the following methods:
$FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
$FolderACL.SetAccessRuleProtection($True,$True)
$FolderACL.Access | where {$_.IdentityReference -eq "BUILTIN\Users"} | %{$FolderACL.RemoveAccessRuleAll($_)}
Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
$FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
$FolderACL.SetAccessRuleProtection($True,$True)
$BIUsers = New-Object System.Security.Principal.NTAccount("BUILTIN\Users")
$BIUsersSID = $BIUsers.Translate([System.Security.Principal.SecurityIdentifier])
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($BIUsersSID.Value,"ReadAndExecute,AppendData,CreateFiles,Synchronize","ContainerInherit, ObjectInherit", "None", "Allow")
$FolderACL.RemoveAccessRuleAll($Ar)
Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
In the first case, the script goes through and has no apparent effect because afterwards, I do a get-acl and the BUILTIN\Users group is still there, although when looking through the GUI, inheritance appears to have been broken from the parent folder.
In the second case, I get the following error message:
Exception calling "RemoveAccessRuleAll" with "1" argument(s): "Some or all identity references could not be translated."
At C:\Users\tesdallb\Documents\FileServerBuild.ps1:110 char:5
+ $FolderACL.RemoveAccessRuleAll($Ar)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : IdentityNotMappedException
This seems strange that the local server is unable to translate the SID of a BUILTIN account. I've also tried explicitly putting in the BUILTIN\Users SID in place of the variable in the New-Object line, but that gives me the same error. I've
also tried the solutions given in this thread:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/ad59dc58-1360-4652-ae09-2cd4273cbd4f/remove-acl-issue?forum=winserverpowershell and at this URL:
http://technet.microsoft.com/en-us/library/ff730951.aspx but these solutions also failed to have any effect.
My second problem is when I try to apply the newly-created security groups, I also will get the "Some or all identity references could not be translated." I thought I had found a workaround to the problem by adding the -PassThru option to
the New-ADGroup commands, because it would output the SID of the group after creation, however a few lines later, the server is unable to translate the account to apply the security groups to the folder.
My first Powershell script has been working well up to this point and now I seem to have hit a showstopper. Any help is appreciated.
Thanks!I was hoping to stay with strictly Powershell, but unless I can find a Powershell solution, I may resort to ICACLS.
As for the problems with my groups not being translatable right after creating them, I think I have solved this problem by using the -Server parameter on all my New-ADGroup commands and this example code seems to have gotten around the translation problem,
again utilizing the -Server parameter on the Get-ADGroup command:
get-acl ($FSRoot + $FolderPath + $FolderName) | fl
$FolderACL = get-acl ($FSRoot + $FolderPath + $FolderName)
# Add the new normal users group to the folder with Read and Execute permissions
$GroupSID = Get-ADGroup -Identity $GroupName -Server chadc01.jacobsonco.com | Select-Object -ExpandProperty SID
$SIDIdentity = New-Object System.Security.Principal.SecurityIdentifier($GroupSID)
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($SIDIdentity,"ReadAndExecute","ContainerInherit, ObjectInherit", "None", "Allow")
$FolderACL.AddAccessRule($Ar)
# Add the management users group to the folder with Modify permissions
$GroupMGMTSID = Get-ADGroup -Identity $GroupNameMGMT -Server chadc01.jacobsonco.com | Select-Object -ExpandProperty SID
$SIDIdentity = New-Object System.Security.Principal.SecurityIdentifier($GroupMGMTSID)
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($SIDIdentity, "Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
$FolderACL.AddAccessRule($Ar)
Set-ACL ($FSRoot + $FolderPath + $FolderName) $FolderACL
Going this route seems to ensure that the Domain Controller I'm creating my groups on is the same one that I'm querying for the group's SID to use in the FileSystemAccessRule. It's been working fairly consistently.
Still having issues with the translation of the BUILTIN\Users group, though. -
Problem with clientgen task in weblogic 9.0
hi,
While developing webservices for our project, we used the clientgen ant task for generating the artifacts on the client side. I'm getting trouble in returning a collection of objects (list, vector) from the server to the client. When i try to do so, the clientgen task tries to create a java.util package on the client side in which it creates a List class which basically contains an object array with getter-setter. What i want is for the sun java collections classes to be used instead. The above problem applies to both user-defined as well as built-in objects i.e. say a list of objects of type T or a list of Strings. If someone, has any pointers regarding the same plz help...
tia,
cyrilTry limiting the length of the session id.
This is in either the weblogic.xml/web.xml
files. You can get the dtd in the 6.0 doc.
"Thierry Cools" <[email protected]> wrote:
>Hi I have a problem with the session id that is generated in tha address bar
>of my brower
>When I start my application the following link appears
>
>http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=Olw9VMc
>0I1Z52YMgycyD23c8L4Ch2FurHLwbV2WhZw731dR3mBtJ|8186718416288373359/-140823374
>1/7001/7002
>
>It seems that Weblogic 6.0 generates '/' characters in the session id.
>This has for consequences that the servlet engine is taking the session id
>in its context path, so that none of my links are working anymore.
>
>Could someone give me a clue to solve this problem
>Thanks,
>Thierry
>
>--
>
>Thierry Cools
>
>Senior Java Developer
>S1 Brussels
>Kleine Kloosterstraat, 23
>1932 st. Stevens-Woluwe
>Belgium
>Tel : +32 2 200 43 82
>Email : [email protected]
>
>
>
-
Problem with Exporting Data to Excel
Hi Everyone,
I have problem with exporting the data to a excel file. I am using a XP
system in German which uses comma "," as the decimal point , and I also set
"Use localized decimal point*" under the FronPanel Options to be true. But
the exported excel file can not recognize (or just ignore) the comma for a
whole column (flow rate), for examle "1,234" (1.234 in non-german system)
would be 1234. But if I open its text file where the data came
from by calling Excel directly, there will be no problem. Is this a bug of
LabVIEW, or I forget some settings?
Thanks a lot!
Le
P.S: The LabVIEW version is 8.2.1 and the Office version is Office2007.Hi Le,
Sound familiar; here in The Netherlands we have the same problem. That is why we use the English versions for XP and Office.
I don’t quite understand how you interface to Excel. Directly with ActiveX or through a CSV file.
Can you explain a bit more ? -
Problem with HTML email formatting
I'm using Firefox 4.0.1. I have a job function that requires me to use web page based email. When responding to emails, Firefox automatically places the cursor at the bottom of the chain as opposed to the top of the chain as in previous versions. I need for the response to start at the top of the page. This is the way it worked in my previous version of Firefox and no settings in the email program have been changed. In fact there is no setting in that program to specify where the response will go. I'm assuming the cursor placement is being determined by Firefox. Please help me change it.
Oooops forgot the link
http://www.adlerhealth.com/ad122607/ad122607.htm
"Ken Binney" <[email protected]> wrote
in message
news:fljkp6$9kc$[email protected]..
> Look at this HTML email.
> The email message is only about 7.5kb because all it's
images are on a
> webserver.
>
>
>
>
> "[email protected]" <[email protected]>
wrote in message
> news:flj9fg$qrg$[email protected]..
>> I've made a few email newsletters, but the problem
that I have is that I
>> can't
>> use a lot of images because when the email is sent
it has a large file
>> size.
>> The images themselves are very big files, like under
10 kb, is there
>> anyway to
>> add multiple images to an email while still keeping
the file size down.
>> Also I
>> have a problem with the formatting of the email.
When the html is placed
>> into
>> an email the spacing isn't right, it usually is the
images that I have
>> problems
>> with. If this is any help I make the newsletters out
of tables. I'd
>> appreciate any tips you can think of.
>>
>
>
Maybe you are looking for
-
To connect my ipod to itunes with windows 8 not see the option to add to add songs from itunes library. As I can solve this?
-
Documents in the Cloud - Need an easy answer
I have OS X Mountain Lion on a 27 inch iMac and 13 inch MacBook Pro, iPhone 4 and an iPad 2. I am trying to use iCloud to sync documents such as Pages Keynote and Numbers between them seamlessly. I have documents in the cloud turned on on all of my d
-
What is my license key # ????
What is my license key #. I cannot open pdf documents withour it????
-
Proforma Invoice triggers automatically through delivery output type
Hi Gurus, Iam facing one issue related proforma invoice, senerios is sales order- once delievry saves, it triggers one output type ZGF8, and it triggers Proforma invoice type ZGF8. In delievry output type ZGF8, we have output program Z_EVT_LIKP_OUTPU
-
Bug - iTunes 5 - Postcasts - Sorting columns doesn't work
Podcast columns in iTunes 5.0 (34) do not sort. The only clickable column is release date, and nothing changes except for the arrow. Would be nice if the other columns were sortable as well.