Search-Mailbox Search Query not returning correct results.
Hi,
I'd appreciate some assistance with the search and delete I'm trying to I'm run.
I'm using the following command to find messages with a certain message class received before 01/01/14 in a mailbox.
Get-Mailbox xxxxxxxxxxxxxxx | Search-Mailbox -SearchQuery '(Received:< 01/01/14) AND ("IPM.Note.Worksite.Ems.Filed")' -EstimateResultOnly | select displayname, success, resultitemscount,Resultitemssize
When I first ran the command it returned 130,000 items, I ran it again with a -DeleteContent switch, all the items were successfully removed from the mailbox, great! However, when I look in the mailbox I can see ~1000 items with the message class in the command
and dated 2013 or earlier, they meet the search criteria so I don't understand why when I run the command again it returns 0 items.
Help!
Hello,
Based on your description, your cmdlet is ok.
When you run the cmdlet with a -DeleteContent switch, the messages are not delete permanently. please try to run the cmdlet with a -DeleteContent switch and -Force switch to check the result.
Besides, please use get-mailboxstatistics | fl cmdlet to check information about mailbox.
Cara Chen
TechNet Community Support
Similar Messages
-
IPTObjectManager.Query not returning correct result (Java)
Hi,
I am having a problem with the IPTObjectManager.Query method. The code is given below. The issue I am having is, that when I search for a community in a specific folder not results are returned. However if I search in all folders (using -1 as the second parameter to the method) it returns multiple communities including the one I need. Anyone else had the same issue with this??
// THIS CODE WORKS AND RETURN MULTIPLE COMMUNITIES
// THE hotelCode VARIABLE IS A STRING VARIABLE CONTAINING A VALUE
// WHICH IS THE COMMUNITY NAME.
// Create a ObjectManager object
IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
// define the query based on the passed string
Object[][] vQueryFilter = {
new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
new Object[]{hotelCode}};
// Run the query and return results
IPTQueryResult ptQueryResult = objectManager.Query(
PT_PROPIDS.PT_PROPID_ALL, -1, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);
// THIS CODE DOES NOT WORK. I AM PASSING IS THE FOLDER ID OF THE
// FOLDER WHICH CONTAINS THE COMMUNITY
// Create a ObjectManager object
IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
// define the query based on the passed string
Object[][] vQueryFilter = {
new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
new Object[]{hotelCode}};
// Run the query and return results
IPTQueryResult ptQueryResult = objectManager.Query(
PT_PROPIDS.PT_PROPID_ALL, 303, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);I don't know about G6, however in version 5 there does not appear an easy way of doing it. I guess the "easiest" way would be to query sub-folders first, build and array of their ids, and then query for communities in those folders. This is using server API. Something like this (.NET):
publicvoidGetFolderCommunities(intfolderId){ IPTAdminFolder folder =this.session.GetAdminCatalog().OpenAdminFolder(folderId, false); IPTQueryResult qr =folder.QuerySubfolders(PT_PROPIDS.PT_PROPID_ALL, [b]1, null, 0, -1, newobject[][] { newobject[] { PT_PROPIDS.PT_PROPID_FOLDER_FOLDERTYPE }, newobject[] { PT_FILTEROPS.PT_FILTEROP_EQ } , newobject[] { PT_ADMIN_FOLDER_TYPES.PT_ADMIN_FOLDER_TYPE_COMMUNITYFOLDER } } ); int[] folderIds =newint[qr.RowCount()]; Console.WriteLine("------ sub-folders for communities -------"); for(inti =0; i <qr.RowCount(); i++) { intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID); stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME); intparentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDER_PARENTFOLDERID); folderIds[i] =objectId; Console.WriteLine("{0}: {1}; parent: {2}", objectId, objectName, parentFolderId); } qr =this.session.GetCommunities().Query( PT_PROPIDS.PT_PROPID_ALL, -1, (object) null, 0, -1, newobject[][] { newobject[] { PT_PROPIDS.PT_PROPID_FOLDERID }, newobject[] { PT_FILTEROPS.PT_FILTEROP_IN } , newobject[] { folderIds } } ); Console.WriteLine("------ communities from sub-folders -------"); for(inti =0; i <qr.RowCount(); i++) { intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID); stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME); int parentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDERID); Console.WriteLine("{0}: {1}; folder: {2}", objectId, objectName, parentFolderId); }}
Or you could use EDK RPC search. Again, in .NET:
publicvoidSearchForCommunities(intfolderId){ IPortalSearchRequest searchRequest =this.ptSession.GetSearchFactory().CreatePortalSearchRequest(); searchRequest.SetObjectTypesToSearch(newObjectClass[] { ObjectClass.Community }); searchRequest.SetDocFoldersToSearch(newint[] {}, true); searchRequest.SetAdminFoldersToSearch(newint[] { folderId}, true); searchRequest.SetResultsCount(0, 100); searchRequest.SetResultsOrderBy(PortalField.OBJECT_ID); searchRequest.SetFieldsToReturn(newPlumtreeField[] {}); searchRequest.SetQuery("*"); ISearchResponse searchResponse =searchRequest.Execute(); intreturnedMatches =searchResponse.GetReturnedCount(); ISearchResultSet resultSet =searchResponse.GetResultSet(); IEnumerator enumerator =resultSet.GetResults(); while(enumerator.MoveNext()) { ISearchResult result =(ISearchResult) enumerator.Current; Console.WriteLine( result.GetFieldAsInt(PortalField.OBJECT_ID) +": "+ result.GetFieldAsString(PlumtreeField.NAME) ); }}
Ruslan. -
SQL Query Not Returning Correct Results
I am trying to pull all records that are set for mailing and
are from every state except for Nebraska and some counties in Iowa.
It isn't pulling correctly. Any help would be greatly appreciated.
SELECT HS_SATCode.School, HS_SATCode.Add1, HS_SATCode.City,
HS_SATCode.State, HS_SATCode.[Zip Code], HS_SATCode.county,
HS_SATCode.mail_list
FROM HS_SATCode
WHERE (((HS_SATCode.State)<>'NE') AND
((HS_SATCode.mail_list)=1)) OR (((HS_SATCode.State)='IA') AND
((HS_SATCode.county)<>'Adair' And
(HS_SATCode.county)<>'adams' And
(HS_SATCode.county)<>'audubon' And
(HS_SATCode.county)<>'buena vista' And
(HS_SATCode.county)<>'calhoun' And
(HS_SATCode.county)<>'carroll' And
(HS_SATCode.county)<>'cass' And
(HS_SATCode.county)<>'cherokee' And
(HS_SATCode.county)<>'clay' And
(HS_SATCode.county)<>'crawford' And
(HS_SATCode.county)<>'dickinson' And
(HS_SATCode.county)<>'fremont' And
(HS_SATCode.county)<>'greene' And
(HS_SATCode.county)<>'guthrie' And
(HS_SATCode.county)<>'harrison' And
(HS_SATCode.county)<>'ida' And
(HS_SATCode.county)<>'lyon' And
(HS_SATCode.county)<>'mills' And
(HS_SATCode.county)<>'monona' And
(HS_SATCode.county)<>'montgomery' And
(HS_SATCode.county)<>'o''brien' And
(HS_SATCode.county)<>'osceola' And
(HS_SATCode.county)<>'page' And
(HS_SATCode.county)<>'pottawattamie' And
(HS_SATCode.county)<>'plymouth' And
(HS_SATCode.county)<>'ringold' And
(HS_SATCode.county)<>'sac' And
(HS_SATCode.county)<>'shelby' And
(HS_SATCode.county)<>'sioux' And
(HS_SATCode.county)<>'tayland' And
(HS_SATCode.county)<>'union' And
(HS_SATCode.county)<>'woodbury') AND
((HS_SATCode.mail_list)=1))
ORDER BY HS_SATCode.mail_list, HS_SATCode.State,
HS_SATCode.countyWow, that's a lotta brackets. And most of them are
unnecessary. Let's reduce it a bit.
WHERE
HS_SATCode.State)<>'NE' AND HS_SATCode.mail_list =1
OR (HS_SATCode.State='IA' AND
HS_SATCode.county<>'Adair' )
Can you see how this will send mail to Nebraska? -
cm:search is not returning any result when logical operator '!' is used.
<cm:search is not returning any result when logical operator '!' is used.
I am using BEA 9.1 content management services API. When I run the following query I am not receiving any results. Also no error or exceptions are seen in the weblogic or cmspi log.
The query is <cm:search id="docs" query="!(object_name like 'Sport*')" />HI cam
Thanks for your reply, but i found the problem it was because my server administrator password has changed by network guys... and because of it crawler unable to access the content
I wrote my solution here i hope it will help other people
http://bvs-sharepoint.blogspot.com/2015/03/sharepoint-search-is-not-returning.html
RB -
Search Query not showing up results
Hi ,
I m firing a UCM query using the UCM admin console ,something like xLanguage <contains> `it-IT`,but it is not returning any results,although the content matching this condition exists in the content server in Released state.I have also rebuild the search indexes.
I m not seeing any errors in the logs as well.
Can anyone tell me what might be going wrong here and what more can i do to debug this.If this is Oracle Text Search, you might be hitting a stop word. ('It' would likely be considered a stop word.)
Try searching using Repository Manager. If the document returns, then in the web ui, try enclosing the search phrase in braces
xLanguage <contains> `{it-IT}` -
Basic NOT EXISTS query not returning any results
DB Version: 10gR2
One of our tables in the test schema is having less number of columns than the PROD shema.
To determine which are missing columns in this table in Test schema i did the following.
-----In Test Schema
CREATE TABLE XYZ2
(COL1 NUMBER); ----------only one column
SQL > CREATE TABLE tables_test_list AS SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLS;
Table created.--- In the prod schema
SQL> CREATE TABLE XYZ2
2 (COL1 NUMBER,
3 COL2 NUMBER ----------- same table name with an extra column
4 );
Table createdAnd from the PROD schema i execute the following SQL to determine what are the columns that are missing in the TEST schema
select column_name from User_Tab_Cols outer
where table_name='XYZ2'
and not exists (select 1 from TEST_SCHEMA.tables_test_list inner where outer.TABLE_NAME=inner.TABLE_NAME )But the above query is not returning any results. Any idea why?Actually, the example from the link I posted earlier:
[email protected]> (
2 select 'IN T1, NOT T2', column_name,data_type,data_length
3 from user_tab_columns
4 where table_name = 'T1'
5 MINUS
6 select 'IN T1, NOT T2', column_name,data_type,data_length
7 from user_tab_columns
8 where table_name = 'T2'
9 )
10 UNION ALL
11 (
12 select 'IN T2, NOT T1', column_name,data_type,data_length
13 from user_tab_columns
14 where table_name = 'T2'
15 MINUS
16 select 'IN T2, NOT T1', column_name,data_type,data_length
17 from user_tab_columns
18 where table_name = 'T1'
19 )
20 / -
Log application query not showing correct results
Hi,
We are running Dataguard (DG) in our production environment. EBS 11.5.10.2 and DB 10.2.0.4.
Every morning we run the following query on both primary and standby to confirm that the logs are being transported and applied to the standby:
select sequence#,applied,to_char(first_time,'mm/dd/yy hh24:mi:ss') first from v$archived_log order by first_time;
Once the logs are transported and applied, a response of 'Yes' is returned for each log generated. We have noticed within the last week that when we run the query on primary, 'No' is being returned, but on standby, 'Yes' is returned. I have confirmed that standby is reflecting the correct results. I've tried restarting the DG service (alter database recover managed standby....) in an attempt to have primary 'refresh' itself but that didn't work.
Does anyone have any idea why primary keeps returning 'No' to the query, and how we can get it to reflect to correct results?
Thanks,
Lia.Hi Werner,
Thanks for your response. Given what you're saying I find that a little strange since prior to this, the query would return a value of 'YES' on the primary. Actually, to be exact, on the primary, each log would should up twice. One would show 'NO' and the other 'YES'- the second indicating transporting and shipping was successful.
This is how the results were before:
SEQUENCE APP FIRST
+154623 NO 04/07/09 08:03:22+
+154623 YES 04/07/09 08:03:22+
+154624 NO 04/07/09 08:05:27+
+154624 YES 04/07/09 08:05:27+
This is how the results are now:
SEQUENCE APP FIRST
+154754 NO 04/22/09 07:22:22+
+154754 NO 04/22/09 07:22:22+
+154755 NO 04/22/09 07:25:27+
+154755 NO 04/22/09 07:25:27+
I'm not doubting that what you're saying is correct, it just adds an element of confusion for me...
Lia. -
ADDT not returning correct results
Hello
SELECT tblTraders.trader_company AS trader_ref, tblTrades.trade_name AS trade_ref, tblT2t.t2t_id
FROM (tblT2t LEFT JOIN tblTraders ON tblT2t.trader_ref = tblTraders.trader_id) LEFT JOIN tblTrades ON tblT2t.trade_ref = tblTrades.trade_id
WHERE {$NXTFilter_rstblT2t1}
ORDER BY {$NXTSort_rstblT2t1}
With reference to the above SQL statement generated while using dynamic list wizard, the SQL does not return the correct results.
Sadly the SQL does not retrieve the field "trade_ref" and is blank when the "test" button is used.
Anyone got any ideas?
Cheers
PaulHi Paul,
does this query return the correct results when loading the page in a browser ?
Cheers,
Günter -
Problems with EVGET not Returning Correct Results
We have several reports with EVGETs that are not working. It seems to be limited to gets on a particular datasrc when getting members at the base level. Here is an example.
Application: Budgeting
Deptid: D_07104
Account: A_612080
Product: P_070040
Project: PJ_NOPROJ
Time: 2009.APR
Datasrc; ACTUALS
Category: INPUT
At this point, all the members above are base level members. A standard EVGET will not return results at this intersection even though there is data. If we change any of the following (Deptid, product, time, or category) to a parent level member, data will be returned. Another action we can take to get data to return is open a new worksheet and write the same EVGET on the same intersection and it will return results. If we go back to the original sheet edit each formula and hit enter it will return the correct results. If we refresh the sheet, the results will disappear. We have also tried EVGTS and get similar results.
Another thing we have tried is copying a month of data from datasrc (ACTUALS) and category (INPUT) to datasrc (NEW_ACTUALS) and category (NEW_INPUT) through the BPC delivered copy. That seems to work. I don't know if the copy does something to load the data that we are missing. We also updated our fact table with a SQL update changing the datasrc and category the same way and processed the application and the data would return through some EVGETs and not others.This issue can happen when you have for onde dimension multiple hierachies and something is wrong into hierachies.
Usually you have dimension formula where you are trying to do calculation of a member from H1 using members from H2.
This it is an example but it can be other possible errors.
Any way for sure your issue is related to one dimension having multiple hierachies.
Regards
Sorin Radulescu -
Spotlight Not Returning Correct Results
Hello everyone,
I have a client who uses Spotlight's metadata across the network to mark files for publishing. They'll use the labels as well as Spotlight comments. Now, an issue that has been bothering them since Lion server was installed is that their results from searches based upon either criteria is inconsistant, both on the server itself and across the network. For instance: a search for anything labeled red will come up with different results each time. On the server, some items show up without a filename. A search for Spotlight comments will return files that have no Spotlight comments, however, running the mdls command on the file will show the Spotlight Comments in the kMDFinderComment field. Rebuilding the index has no effect on this problem. Any solutions out there?
Mac Mini Server running OS X Server 10.7.2
2GB RAMI have a similar problem. When I click on the Show All in Finder, the results are meaningless. I get a listing of hundreds of files that have nothing to do with the search word.
For example, if I put "house" in the search window, I get, for example:
X Prize Update | 25 Years of PCR | Australia's Stem Cell Center
X Prize Update | 25 Years of PCR | Australia's Stem Cell Center
wx_printingoverview.html
wx_odbcoverview.html
wx_classesbycat.html
wp_smart-grid-comms_en_xg.pdf
Variable Area Technologies / Rotameters And Cole-Parmer Economical Spring-Loaded Flowmeters - Cole-Parmer Catalog.pdf
Utility Breakdown 6 09-5 10.xlsx
Utility Breakdown 6 09-5 10.xlsx
User Guide.pdf
User Guide
This makes the Show in Finder completely useless. -
CF Not Returning Correct Results
I have a column that has both positive and negative numbers and I am trying to seperate those numbers into a seperate column each. My code below is working if each barcode has both a positive and negative number to compare, but errors are thrown such as "can't convert " to a numeric value" if I just have all positive numbers in the colum. Which, in some casees, I will have because I am importing a CSV file. Can anyone help with the code? - Thanks.
<!--- SUM POSITVE QUANTITY --->
<cfquery name="SumPositiveTemp" datasource='inventory'>
SELECT barcode, sum(quantity) as quantitysumPositive
FROM temp
WHERE Quantity > 0
GROUP BY barcode
</cfquery>
<!--- SUM NEGATIVE QUANTITY --->
<cfquery name="SumNegativeTemp" datasource='inventory'>
SELECT barcode, sum(quantity) as quantitysumNegative
FROM temp
WHERE Quantity < 0
GROUP BY barcode
</cfquery>
<!--- SUBTRACT QUANTITY ISSUED MINUS QUANTITY RECEIVED TO GET QUANTITY SOLD --->
<cfset QuanitySold = '#SumPositiveTemp.quantitysumPositve-SumNegativeTempquantitysumNegative#'>
<!--- INSERT POSITVIE/NEGATIVE NUMBERS INTO TABLE--->
<cfoutput query="SumPositiveTemp">
<cfquery name="InsertPositiveIntoCart" datasource="inventory">
INSERT INTO Cart1 (barcode, QuantityOut, QuantityIn, QuantitySold)
VALUES (#SumPositiveTemp.barcode#, #SumPositiveTemp.quantitysumPositive#, #SumNegativeTemp.quantitysumNegative#, #QuantitySold#)
</cfquery>
</cfoutput>geraldselectric225 wrote:
Yes, I found that when the barcode did not have matching POS and NEG numbers it would return a null value. After more research, I found that <CFIF ISNUMERIC(NEG VALUE)> was the solution to avoiding a null value and use <CFSET NEG VALUE = 0> in that situation.
What you have is good. I think you could improve it with this kind of logic:
<cfif NOT isNumeric(someVar) or someVar LTE 0>
<cfset someVar = 0>
</cfif> -
Query not returning correct number of records
Hi Guys,
Can someone please tell me why this query is not retrieving the correct number of records.
I have a table with six users
FIRST_NAME LAST_NAME
David Robert
Martin Fisher
Henry Robert King
Edmund Tomkinson
Williams Hayes Robert
Tina Belkins
When I run a query, SELECT * FROM USERS WHERE LAST_NAME LIKE 'Robert';
I only get 1 record back (David Robert). Is the space between the last name
causing this? If yes, How can I rewite the query?show a copy-paste example of your query...
you need to use a wild card with LIKE, as in
SQL> create table test
2 (first_name varchar2(50)
3 ,last_name varchar2(50)
4 );
Table created.
SQL>
SQL> insert into test values ('David' , 'Robert' );
1 row created.
SQL> insert into test values ('Martin', 'Fisher' );
1 row created.
SQL> insert into test values ('Henry' , 'Robert King' );
1 row created.
SQL> insert into test values ('Edmund', 'Tomkinson' );
1 row created.
SQL> insert into test values ('Williams', 'Hayes Robert');
1 row created.
SQL> insert into test values ('Tina', 'Belkins');
1 row created.
SQL>
SQL> SELECT * FROM test WHERE LAST_NAME LIKE 'Robert';
FIRST_NAME
LAST_NAME
David
Robert
SQL>
SQL> SELECT * FROM test WHERE LAST_NAME LIKE '%Robert%';
FIRST_NAME
LAST_NAME
David
Robert
Henry
Robert King
Williams
Hayes Robert -
$Web.AssociatedGroups is not returning correct results
Hi all, I have a script that syncs AD Groups to SharePoint Groups. If you ask me why, because SharePoint works better with Users in SharePoint Groups, not AD Groups (Workflows and other stuff like Site Mailbox). But this is not the Point, I am struggeling
with the AssociatedGroups property of the Web Object. The first sync works, but then I do not get the right values when I change associations and resync. It only stays with the first values.
Example: I add a Group AD_SMB-Test to a Web, then to a Subweb. Then I remove it from the parent web, but leave it on the Subweb. The AssociatedGroups Property of the Web Object now still shows the group, even if I removed it. Any Ideas?
To understand the Script, here it is...
asnp *sharepoint*
# Give the WebApplication you want to Sync
$RootWebApp = "https://portal.demo.local"
$Domain = "DEMO\"
# Find all Site Collections
$Sites = ($RootWebApp | Get-SPSite -Limit All)
foreach ($Site in $Sites){
$SyncedGroupArray = @()
#Find all Webs
$Webs = $Site.AllWebs
foreach ($Web in $Webs) {
Write-Host "Going for Web : " -NoNewline -ForegroundColor Green
$Web.Url
# Find all Groups
$SPGroups = $Web.AssociatedGroups
foreach ($SPGroup in $SPGroups){
Write-Host "Now getting Group : " -NoNewline -ForegroundColor Yellow
$SPGroup.Name
# If one of the SharePoint Groups starts with "AD_" then it should be synced
if ($SPGroup.ToString().StartsWith("AD_") -eq $true){
$ADGroupName = $SPGroup.ToString().Remove(0,3)
$ADGroup = Get-ADGroup -Filter {name -eq $ADGroupName}
# Check if Group was already synced through another Web
if ($SyncedGroupArray -contains $SPGroup.Name) {
Write-Host "Group already synce, breaking out"
break
# Check if AD Group really exists
if ($ADGroup -ne $null){
$ADGroupMembers = Get-ADGroupMember -Identity $ADGroup
# Take all Members Login of this AD Group into an Array to make up SharePoint
$SAMArray = @()
foreach ($ADGroupMember in $ADGroupMembers) {
$SAMArray = $SAMArray + ($Domain + $ADGroupMember.SamAccountName)
# Now iterate through SharePoint Group to find users that need to be deleted and create an Array with all of the "left overs"
$SPUserArray = @()
foreach ($SPUser in $SPGroup.Users) {
$SPUserlogin = $SPUser.LoginName.ToString().Remove(0,7)
if ($SAMArray -contains $SPUserlogin) {
$SPUserArray = $SPUserArray + $SPUserlogin
else {
$SPGroup.RemoveUser($SPUser)
# Now iterate through the AD Group and add missing members to SharePoint Group
foreach ($ADGroupMember in $ADGroupMembers) {
$ADUser = $Domain + $ADGroupMember.SamAccountName
if ($SPUserArray -contains $ADUser) {
#Do nothing, User is already present
else {
New-SPUser $ADUser -Web $Web.Url -Group $SPGroup.Name
# Set this Group marked as Synced for this Site Collectin
$SyncedGroupArray = $SyncedGroupArray + $SPGroup.Name
$Web.Dispose()
# sleep 5Not sure what you mean when you say you remove the group from the parent. Groups are always maintained for an entire site collection. You can remove the permissions assigned to a group at the parent level, but that won't remove the group. The
group is still there.
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
Query not retrieving correct result set
I have a query that doesn't seem to be executing its where clause. I used getQuery to check it and ran it in SQL Navigator where it works fine. The same query doesn't work correctly when executed in the OA Framework. Any ideas?
Thanks.Mbolton,
Try asking on the OA Framework Forum.
Best regards,
John "Ask it on the OA Framework Forum" Stegeman -
SCCM query not returning the results I want
I would like to use a query that will query my systems that have a particular piece of software (Flash), but I do not want it to include servers that are in a particular group.
Explanation: I have about 20 servers with Flash installed that require it. About half of them I can update regularly, the other half I can't. So, I have an AD group for each - the ones I can patch, and the ones I can't. I want the query
to look for systems with "Adobe Flash" in the display name, but exclude the servers in both of these groups. That way I can create a collection of computers that have Flash installed where it shouldn't be and can keep an eye on where it is
being installed.
The query looks like this in the criteria tab;
Add/Remove Programs.Display Name is like "%Adobe Flash%"
and
System Resource.System Group Name is not equal to "LAB\FlashPatchGroup"
The query language looks like this;
select distinct SMS_R_System.Name, SMS_R_System.description, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName, SMS_G_System_ADD_REMOVE_PROGRAMS.Version from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID
= SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Adobe Flash%" and SMS_R_System.SystemGroupName != "LAB\\FlashPatchGroup"
The problem I am having is that when I run the query, it is pulling everything with Flash, including the ones in the AD group. Anyone see a problem with the way I'm doing this?Hi Jorgen,
Thank you for that - very helpful because I actually knew nothing about sub-select queries. So now the overall logic makes sense, but unfortunately the only examples I've been able to find don't cover exactly what I want to do.
The overall examples I have found work like this;
- Create a query to find computers with a particular application installed
- Create a subselect query that says find users that are NOT subject to the preceeding query
What I need to do, however, is this;
- A query finds computers with a particular piece of software installed
- It compares the computer to 2 Active Directory groups I have created.
- The query produces all computers with that particular piece of software that is NOT in the AD groups I have created. This way I can easily identify servers that have Flash installed that shouldn't.
Any ideas? I have been trying to follow the subselect queries to do something similar but I just cannot make it work. I've tried to create a subselect query that says "Add/Remove Programs Display Name contains "%Adobe Flash%" but is not in (subselect
query)" and it just doesn't like it.
Regards
Juice
Maybe you are looking for
-
Hi, I have a Web Start application that needs to have email capability added to it. The email will be sending two text attachments. Is JavaMail the right way to go? Thanks for commenting. hopi
-
Export dump(logical backup) runing since yesterday
Hi to All, We are taking full export dump(logical backup) of database.till last week its fine on sunday we change the password of administrator and we forgot to change to password in this scheduled scripts.and yesterday i run this backup manullay in
-
RMI JNDI Lookup on remote iAS causing "Not Authorised"
Hi all I'm running through an OJMS example using AQ and all is looking good until I try and Update my plan from Design Studio.. I get: IMessageSourceReceiver->messageReceive: javax.naming.NamingException: Lookup error: javax.naming.AuthenticationExce
-
IM working on this Flash menu and i can't seem to change the names on the menu please someone help me how to change the names thanks http://i294.photobucket.com/albums/mm87/Gorla89/Untitled.png Here is the source file [URL=http://www.zshare.net/
-
Has anyone used the mackeeper program by zeobit
has anyone used the mackeeper program by zeobits